Package gov.nih.mipav.model.file.rawjp2
Class BEByteArrayOutputStream
java.lang.Object
java.io.OutputStream
java.io.ByteArrayOutputStream
gov.nih.mipav.model.file.rawjp2.BEByteArrayOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable,jj2000.j2k.fileformat.FileFormatBoxes
public class BEByteArrayOutputStream
extends ByteArrayOutputStream
implements jj2000.j2k.fileformat.FileFormatBoxes
Big Endian Output Array Stream, works as a replacement for FileFormatWriter
at the output of Jpeg2K encoder.
- Author:
- Dzung Nguyen
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intLength of codestreamprivate static final intLength of Colour Specification Boxprivate static final intLength of File Type Boxprivate intImage heightprivate static final intLength of Image Header Boxprivate intImage widthFields inherited from class java.io.ByteArrayOutputStream
buf, countFields inherited from interface jj2000.j2k.fileformat.FileFormatBoxes
BITS_PER_COMPONENT_BOX, CAPTURE_RESOLUTION_BOX, CHANNEL_DEFINITION_BOX, COLOUR_SPECIFICATION_BOX, COMPONENT_MAPPING_BOX, CONTIGUOUS_CODESTREAM_BOX, CSB_APPROX, CSB_ENUM_GREY, CSB_ENUM_SRGB, CSB_METH, CSB_PREC, DEFAULT_DISPLAY_RESOLUTION_BOX, FILE_TYPE_BOX, FT_BR, IMAGE_HEADER_BOX, IMB_C, IMB_IPR, IMB_UnkC, IMB_VERS, INTELLECTUAL_PROPERTY_BOX, JP2_HEADER_BOX, JP2_SIGNATURE_BOX, PALETTE_BOX, RESOLUTION_BOX, URL_BOX, UUID_BOX, UUID_INFO_BOX, UUID_LIST_BOX, XML_BOX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidThis method writes the Colour Specification boxvoidwriteContiguousCodeStreamBox(byte[] cs) This method writes the Contiguous codestream boxintThis method reads the codestream and writes the file format wrapper and the codestream to the same filevoidThis method writes the File Type boxvoidThis method writes the Image Header boxvoidwriteInt(int b) voidThis method writes the JP2Header boxvoidwriteShortInt(int b) Methods inherited from class java.io.ByteArrayOutputStream
close, reset, size, toByteArray, toString, toString, toString, toString, write, write, writeBytes, writeToMethods inherited from class java.io.OutputStream
flush, nullOutputStream, write
-
Field Details
-
height
private int heightImage height -
width
private int widthImage width -
clength
private int clengthLength of codestream -
CSB_LENGTH
private static final int CSB_LENGTHLength of Colour Specification Box- See Also:
-
FTB_LENGTH
private static final int FTB_LENGTHLength of File Type Box- See Also:
-
IHB_LENGTH
private static final int IHB_LENGTHLength of Image Header Box- See Also:
-
-
Constructor Details
-
BEByteArrayOutputStream
public BEByteArrayOutputStream() -
BEByteArrayOutputStream
- Throws:
IOException
-
-
Method Details
-
writeInt
public void writeInt(int b) -
writeShortInt
public void writeShortInt(int b) -
writeFileFormat
This method reads the codestream and writes the file format wrapper and the codestream to the same file- Returns:
- The number of bytes increases because of the file format
- Throws:
IOException- If an I/O error ocurred.
-
writeFileTypeBox
This method writes the File Type box- Throws:
IOException- If an I/O error ocurred.
-
writeJP2HeaderBox
This method writes the JP2Header box- Throws:
IOException- If an I/O error ocurred.
-
writeColourSpecificationBox
This method writes the Colour Specification box- Throws:
IOException- If an I/O error ocurred.
-
writeImageHeaderBox
This method writes the Image Header box- Throws:
IOException- If an I/O error ocurred.
-
writeContiguousCodeStreamBox
This method writes the Contiguous codestream box- Parameters:
cs- The contiguous codestream- Throws:
IOException- If an I/O error ocurred.
-