[]
        
(Showing Draft Content)

CSJ2K.j2k.codestream.writer.FileCodestreamWriter

FileCodestreamWriter Class

Inheritance
FileCodestreamWriter
Namespace: CSJ2K.j2k.codestream.writer
Assembly: C1.WPF.PdfViewer.4.6.2.dll
Syntax
public class FileCodestreamWriter : CodestreamWriter

Constructors

Name Description
FileCodestreamWriter(Stream, int)

Uses the output stream 'os' for writing the bit stream, using the 'he' header encoder. The magic number is written to the bit stream. Normally, the header encoder must be empty (i.e. no data has been written to it yet). No BufferedOutputStream is used on top of the output stream 'os'.

FileCodestreamWriter(object, int)

Opens the file 'file' for writing the codestream. The magic number is written to the bit stream. Normally, the header encoder must be empty (i.e. no data has been written to it yet). A BufferedOutputStream is used on top of the file to increase throughput, the length of the buffer is DEF_BUF_LEN.

FileCodestreamWriter(string, int)

Opens the file named 'fname' for writing the bit stream, using the 'he' header encoder. The magic number is written to the bit stream. Normally, the header encoder must be empty (i.e. no data has been written to it yet). A BufferedOutputStream is used on top of the file to increase throughput, the length of the buffer is DEF_BUF_LEN.

Fields

Name Description
DEF_BUF_LEN

The default buffer length, 1024 bytes

Properties

Name Description
Length

Returns the current length of the entire bit stream.

MaxAvailableBytes

Returns the number of bytes remaining available in the bit stream. This is the maximum allowed number of bytes minus the number of bytes that have already been written to the bit stream. If more bytes have been written to the bit stream than the maximum number of allowed bytes, then a negative value is returned.

OffLastROIPkt

Gives the offset of the end of last packet containing ROI information

Methods

Name Description
close()

Writes the EOC marker and closes the underlying stream.

commitBitstreamHeader(HeaderEncoder)

Writes the header data in the codestream and actualize ndata with the header length. The header is either a MainHeaderEncoder or a TileHeaderEncoder.

writePacketBody(byte[], int, bool, bool, int)

Writes a packet body to the codestream and returns the number of bytes used by this body. If in simulation mode then no data is written to the bit stream but the number of bytes is calculated. This can be used for iterative rate allocation.

       <p>If the number of bytes that has to be written to the codestream is
       more than the space left (as returned by getMaxAvailableBytes()), only
       the data that does not exceed the allowed length is effectively written
       and the rest is discarded. However the value returned by the method is
       the total length of the packet, as if all of it was written to the bit
       stream.</p>
writePacketHead(byte[], int, bool, bool, bool)