pixelmed
Public Member Functions | Protected Attributes | List of all members
com.pixelmed.codec.jpeg.OutputArrayOrStream Class Reference
Collaboration diagram for com.pixelmed.codec.jpeg.OutputArrayOrStream:
Collaboration graph
[legend]

Public Member Functions

 OutputArrayOrStream ()
 
 OutputArrayOrStream (OutputStream out, ByteOrder order)
 
 OutputArrayOrStream (byte[] byteValues)
 
 OutputArrayOrStream (short[] shortValues)
 
void setOutputStream (OutputStream out, ByteOrder order) throws IOException
 
ByteOrder order ()
 
void order (ByteOrder order) throws IOException
 
void allocateByteArray (int length) throws IOException
 
void allocateShortArray (int length) throws IOException
 
OutputStream getOutputStream ()
 
byte [] getByteArray ()
 
short [] getShortArray ()
 
void writeByte (int b) throws IOException
 Writes the specified byte to this output. More...
 
void writeShort (int s) throws IOException
 Writes the specified short to this output. More...
 
void close () throws IOException
 

Protected Attributes

OutputStream out = null
 
ByteOrder order = null
 
byte [] byteValues = null
 
short [] shortValues = null
 
int byteOffset = 0
 
int shortOffset = 0
 

Detailed Description

A class that allows writing to either an OutputStream or a byte[] or short[] of preallocated size.

An unallocated instance may be constructed but any attempt to write to it will fail until either an OutputStream is assigned or an array of the appropriate type is allocated. This allows, for example, the instance to be created and later allocated based on size information, e.g., as header information is encountered while decompressing before decompressed pixel values need to be written.

Author
dclunie

Definition at line 22 of file OutputArrayOrStream.java.

Constructor & Destructor Documentation

◆ OutputArrayOrStream() [1/4]

com.pixelmed.codec.jpeg.OutputArrayOrStream.OutputArrayOrStream ( )

Definition at line 33 of file OutputArrayOrStream.java.

◆ OutputArrayOrStream() [2/4]

com.pixelmed.codec.jpeg.OutputArrayOrStream.OutputArrayOrStream ( OutputStream  out,
ByteOrder  order 
)

Definition at line 37 of file OutputArrayOrStream.java.

References com.pixelmed.codec.jpeg.OutputArrayOrStream.order(), and com.pixelmed.codec.jpeg.OutputArrayOrStream.out.

Here is the call graph for this function:

◆ OutputArrayOrStream() [3/4]

com.pixelmed.codec.jpeg.OutputArrayOrStream.OutputArrayOrStream ( byte []  byteValues)

◆ OutputArrayOrStream() [4/4]

com.pixelmed.codec.jpeg.OutputArrayOrStream.OutputArrayOrStream ( short []  shortValues)

Member Function Documentation

◆ allocateByteArray()

void com.pixelmed.codec.jpeg.OutputArrayOrStream.allocateByteArray ( int  length) throws IOException

Definition at line 82 of file OutputArrayOrStream.java.

Referenced by com.pixelmed.codec.jpeg.Parse.DecompressedOutput.configureDecompressedOutput().

Here is the caller graph for this function:

◆ allocateShortArray()

void com.pixelmed.codec.jpeg.OutputArrayOrStream.allocateShortArray ( int  length) throws IOException

Definition at line 90 of file OutputArrayOrStream.java.

Referenced by com.pixelmed.codec.jpeg.Parse.DecompressedOutput.configureDecompressedOutput().

Here is the caller graph for this function:

◆ close()

void com.pixelmed.codec.jpeg.OutputArrayOrStream.close ( ) throws IOException

Closes any assigned OutputStream.

Does nothing if arrays allocated instead of an OutputStream (i.e., does NOT release them).

Exceptions
IOExceptionif an I/O error occurs.

Definition at line 166 of file OutputArrayOrStream.java.

Referenced by com.pixelmed.codec.jpeg.Parse.DecompressedOutput.close().

Here is the caller graph for this function:

◆ getByteArray()

byte [] com.pixelmed.codec.jpeg.OutputArrayOrStream.getByteArray ( )

Definition at line 102 of file OutputArrayOrStream.java.

References com.pixelmed.codec.jpeg.OutputArrayOrStream.byteValues.

Referenced by com.pixelmed.imageio.JPEGLosslessImageReader.read().

Here is the caller graph for this function:

◆ getOutputStream()

OutputStream com.pixelmed.codec.jpeg.OutputArrayOrStream.getOutputStream ( )

◆ getShortArray()

short [] com.pixelmed.codec.jpeg.OutputArrayOrStream.getShortArray ( )

Definition at line 106 of file OutputArrayOrStream.java.

References com.pixelmed.codec.jpeg.OutputArrayOrStream.shortValues.

Referenced by com.pixelmed.imageio.JPEGLosslessImageReader.read().

Here is the caller graph for this function:

◆ order() [1/2]

ByteOrder com.pixelmed.codec.jpeg.OutputArrayOrStream.order ( )

Retrieves the OutputStream's byte order used when writing short values.

Returns
The OutputStream's byte order, or null if no OutputStream

Definition at line 65 of file OutputArrayOrStream.java.

Referenced by com.pixelmed.codec.jpeg.OutputArrayOrStream.order(), com.pixelmed.codec.jpeg.OutputArrayOrStream.OutputArrayOrStream(), and com.pixelmed.codec.jpeg.OutputArrayOrStream.setOutputStream().

Here is the caller graph for this function:

◆ order() [2/2]

void com.pixelmed.codec.jpeg.OutputArrayOrStream.order ( ByteOrder  order) throws IOException

Modifes the OutputStream's byte order used when writing short values.

Parameters
orderthe new byte order, either BIG_ENDIAN or LITTLE_ENDIAN
Exceptions
IOExceptionif no OutputStream assigned

Definition at line 75 of file OutputArrayOrStream.java.

References com.pixelmed.codec.jpeg.OutputArrayOrStream.order().

Here is the call graph for this function:

◆ setOutputStream()

void com.pixelmed.codec.jpeg.OutputArrayOrStream.setOutputStream ( OutputStream  out,
ByteOrder  order 
) throws IOException

Definition at line 52 of file OutputArrayOrStream.java.

References com.pixelmed.codec.jpeg.OutputArrayOrStream.order(), and com.pixelmed.codec.jpeg.OutputArrayOrStream.out.

Here is the call graph for this function:

◆ writeByte()

void com.pixelmed.codec.jpeg.OutputArrayOrStream.writeByte ( int  b) throws IOException

Writes the specified byte to this output.

Parameters
bthe byte.
Exceptions
IOExceptionif an I/O error occurs.

Definition at line 116 of file OutputArrayOrStream.java.

Referenced by com.pixelmed.codec.jpeg.EntropyCodedSegment.EntropyCodedSegment().

Here is the caller graph for this function:

◆ writeShort()

void com.pixelmed.codec.jpeg.OutputArrayOrStream.writeShort ( int  s) throws IOException

Writes the specified short to this output.

Parameters
sthe short.
Exceptions
IOExceptionif an I/O error occurs.

Definition at line 137 of file OutputArrayOrStream.java.

Referenced by com.pixelmed.codec.jpeg.EntropyCodedSegment.EntropyCodedSegment().

Here is the caller graph for this function:

Member Data Documentation

◆ byteOffset

int com.pixelmed.codec.jpeg.OutputArrayOrStream.byteOffset = 0
protected

Definition at line 30 of file OutputArrayOrStream.java.

◆ byteValues

byte [] com.pixelmed.codec.jpeg.OutputArrayOrStream.byteValues = null
protected

◆ order

ByteOrder com.pixelmed.codec.jpeg.OutputArrayOrStream.order = null
protected

Definition at line 27 of file OutputArrayOrStream.java.

◆ out

OutputStream com.pixelmed.codec.jpeg.OutputArrayOrStream.out = null
protected

◆ shortOffset

int com.pixelmed.codec.jpeg.OutputArrayOrStream.shortOffset = 0
protected

Definition at line 31 of file OutputArrayOrStream.java.

◆ shortValues

short [] com.pixelmed.codec.jpeg.OutputArrayOrStream.shortValues = null
protected