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:
java.io.Closeable
,java.io.Flushable
,java.lang.AutoCloseable
,jj2000.j2k.fileformat.FileFormatBoxes
public class BEByteArrayOutputStream extends java.io.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:
ByteArrayOutputStream
,FileFormatBoxes
-
-
Field Summary
Fields Modifier and Type Field Description private int
clength
Length of codestreamprivate static int
CSB_LENGTH
Length of Colour Specification Boxprivate static int
FTB_LENGTH
Length of File Type Boxprivate int
height
Image heightprivate static int
IHB_LENGTH
Length of Image Header Boxprivate int
width
Image width-
Fields 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 Constructor Description BEByteArrayOutputStream()
BEByteArrayOutputStream(java.io.ByteArrayOutputStream bs, int w, int h)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
writeColourSpecificationBox()
This method writes the Colour Specification boxvoid
writeContiguousCodeStreamBox(byte[] cs)
This method writes the Contiguous codestream boxint
writeFileFormat()
This method reads the codestream and writes the file format wrapper and the codestream to the same filevoid
writeFileTypeBox()
This method writes the File Type boxvoid
writeImageHeaderBox()
This method writes the Image Header boxvoid
writeInt(int b)
void
writeJP2HeaderBox()
This method writes the JP2Header boxvoid
writeShortInt(int b)
-
-
-
Field Detail
-
height
private int height
Image height
-
width
private int width
Image width
-
clength
private int clength
Length of codestream
-
CSB_LENGTH
private static final int CSB_LENGTH
Length of Colour Specification Box- See Also:
- Constant Field Values
-
FTB_LENGTH
private static final int FTB_LENGTH
Length of File Type Box- See Also:
- Constant Field Values
-
IHB_LENGTH
private static final int IHB_LENGTH
Length of Image Header Box- See Also:
- Constant Field Values
-
-
Method Detail
-
writeInt
public void writeInt(int b)
-
writeShortInt
public void writeShortInt(int b)
-
writeFileFormat
public int writeFileFormat() throws java.io.IOException
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:
java.io.IOException
- If an I/O error ocurred.
-
writeFileTypeBox
public void writeFileTypeBox() throws java.io.IOException
This method writes the File Type box- Throws:
java.io.IOException
- If an I/O error ocurred.
-
writeJP2HeaderBox
public void writeJP2HeaderBox() throws java.io.IOException
This method writes the JP2Header box- Throws:
java.io.IOException
- If an I/O error ocurred.
-
writeColourSpecificationBox
public void writeColourSpecificationBox() throws java.io.IOException
This method writes the Colour Specification box- Throws:
java.io.IOException
- If an I/O error ocurred.
-
writeImageHeaderBox
public void writeImageHeaderBox() throws java.io.IOException
This method writes the Image Header box- Throws:
java.io.IOException
- If an I/O error ocurred.
-
writeContiguousCodeStreamBox
public void writeContiguousCodeStreamBox(byte[] cs) throws java.io.IOException
This method writes the Contiguous codestream box- Parameters:
cs
- The contiguous codestream- Throws:
java.io.IOException
- If an I/O error ocurred.
-
-