[]
        
(Showing Draft Content)

CSJ2K.j2k.entropy.encoder.ByteOutputBuffer

ByteOutputBuffer Class

This class provides a buffering output stream similar to ByteArrayOutputStream, with some additional methods.

       <p>Once an array has been written to an output stream or to a byte array,
       the object can be reused as a new stream if the reset() method is
       called.</p><p>Unlike the ByteArrayOutputStream class, this class is not thread
       safe.</p>
Inheritance
ByteOutputBuffer
Namespace: CSJ2K.j2k.entropy.encoder
Assembly: C1.WPF.PdfViewer.4.6.2.dll
Syntax
public class ByteOutputBuffer

Constructors

Name Description
ByteOutputBuffer()

Creates a new byte array output stream. The buffer capacity is initially BUF_DEF_LEN bytes, though its size increases if necessary.

ByteOutputBuffer(int)

Creates a new byte array output stream, with a buffer capacity of the specified size, in bytes.

Fields

Name Description
BUF_DEF_LEN

The default initial buffer size

BUF_INC

The buffer increase size

Methods

Name Description
getByte(int)

Returns the byte buffered at the given position in the buffer. The position in the buffer is the index of the 'write()' method call after the last call to 'reset()'.

reset()

Discards all the buffered data, by resetting the counter of written bytes to 0.

size()

Returns the number of valid bytes in the output buffer (count class variable).

toByteArray(int, int, byte[], int)

Copies the specified part of the stream to the 'outbuf' byte array.

write(int)

Writes the specified byte to this byte array output stream. The functionality provided by this implementation is the same as for the one in the superclass, however this method is not synchronized and therefore not safe thread, but faster.

See Also