Top Description Fields Constructors Methods
jogamp.opengl.util.pngj

pack-priv abstract Class ProgressiveOutputStream

extends ByteArrayOutputStream
Class Inheritance
Known Direct Subclasses
jogamp.opengl.util.pngj.PngIDatChunkOutputStream
Imports
java.io.ByteArrayOutputStream, .IOException

stream that outputs to memory and allows to flush fragments every 'size' bytes to some other destination

Field Summary

Modifier and TypeField and Description
private long
private final int
Inherited from java.io.ByteArrayOutputStream:
bufcount

Constructor Summary

AccessConstructor and Description
public
ProgressiveOutputStream(final int size)

Method Summary

Modifier and TypeMethod and Description
private final void
checkFlushBuffer(final boolean forced)

if it's time to flush data (or if forced==true) calls abstract method flushBuffer() and cleans those bytes from own buffer

public final void
close()

Overrides java.io.ByteArrayOutputStream.close.

Implements java.io.Closeable.close.

Closing a ByteArrayOutputStream has no effect.
public final void
flush()

Overrides java.io.OutputStream.flush.

Implements java.io.Flushable.flush.

Flushes this output stream and forces any buffered output bytes to be written out.
protected abstract void
flushBuffer(byte[] b, int n)

public long
public final synchronized void
reset()

Overrides java.io.ByteArrayOutputStream.reset.

Resets the count field of this ByteArrayOutputStream to zero, so that all currently accumulated output in the output stream is discarded.
public final void
write(final byte[]
the data.
b
,
final int
the start offset in the data.
off
,
final int
the number of bytes to write.
len
)

Overrides java.io.ByteArrayOutputStream.write.

Writes len bytes from the specified byte array starting at offset off to this ByteArrayOutputStream.
public final void
write(final byte[]
the data.
b
)

Overrides java.io.OutputStream.write.

Writes b.length bytes from the specified byte array to this output stream.
public final void
write(final int
the byte to be written.
arg0
)

Overrides java.io.ByteArrayOutputStream.write.

Writes the specified byte to this ByteArrayOutputStream.
Inherited from java.io.ByteArrayOutputStream:
sizetoByteArraytoStringtoStringtoStringtoStringwriteByteswriteTo

Field Detail

countFlushedback to summary
private long countFlushed
sizeback to summary
private final int size

Constructor Detail

ProgressiveOutputStreamback to summary
public ProgressiveOutputStream(final int size)

Method Detail

checkFlushBufferback to summary
private final void checkFlushBuffer(final boolean forced)

if it's time to flush data (or if forced==true) calls abstract method flushBuffer() and cleans those bytes from own buffer

closeback to summary
public final void close() throws IOException

Overrides java.io.ByteArrayOutputStream.close.

Implements java.io.Closeable.close.

Doc from java.io.ByteArrayOutputStream.close.

Closing a ByteArrayOutputStream has no effect. The methods in this class can be called after the stream has been closed without generating an IOException.

Annotations
@Override
Exceptions
IOException:

Doc from java.io.OutputStream.close.

if an I/O error occurs.

flushback to summary
public final void flush() throws IOException

Overrides java.io.OutputStream.flush.

Implements java.io.Flushable.flush.

Doc from java.io.OutputStream.flush.

Flushes this output stream and forces any buffered output bytes to be written out. The general contract of flush is that calling it is an indication that, if any bytes previously written have been buffered by the implementation of the output stream, such bytes should immediately be written to their intended destination.

If the intended destination of this stream is an abstraction provided by the underlying operating system, for example a file, then flushing the stream guarantees only that bytes previously written to the stream are passed to the operating system for writing; it does not guarantee that they are actually written to a physical device such as a disk drive.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
flushBufferback to summary
protected abstract void flushBuffer(byte[] b, int n)
getCountFlushedback to summary
public long getCountFlushed()
resetback to summary
public final synchronized void reset()

Overrides java.io.ByteArrayOutputStream.reset.

Doc from java.io.ByteArrayOutputStream.reset.

Resets the count field of this ByteArrayOutputStream to zero, so that all currently accumulated output in the output stream is discarded. The output stream can be used again, reusing the already allocated buffer space.

Annotations
@Override
writeback to summary
public final void write(final byte[] b, final int off, final int len)

Overrides java.io.ByteArrayOutputStream.write.

Doc from java.io.ByteArrayOutputStream.write.

Writes len bytes from the specified byte array starting at offset off to this ByteArrayOutputStream.

Parameters
b:byte[]

the data.

off:int

the start offset in the data.

len:int

the number of bytes to write.

Annotations
@Override
writeback to summary
public final void write(final byte[] b) throws IOException

Overrides java.io.OutputStream.write.

Doc from java.io.OutputStream.write.

Writes b.length bytes from the specified byte array to this output stream. The general contract for write(b) is that it should have exactly the same effect as the call write(b, 0, b.length).

Parameters
b:byte[]

the data.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
writeback to summary
public final void write(final int arg0)

Overrides java.io.ByteArrayOutputStream.write.

Doc from java.io.ByteArrayOutputStream.write.

Writes the specified byte to this ByteArrayOutputStream.

Parameters
arg0:int

the byte to be written.

Annotations
@Override