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 Details

    • 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:
    • FTB_LENGTH

      private static final int FTB_LENGTH
      Length of File Type Box
      See Also:
    • IHB_LENGTH

      private static final int IHB_LENGTH
      Length of Image Header Box
      See Also:
  • Constructor Details

  • Method Details

    • writeInt

      public void writeInt(int b)
    • writeShortInt

      public void writeShortInt(int b)
    • writeFileFormat

      public int writeFileFormat() throws 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:
      IOException - If an I/O error ocurred.
    • writeFileTypeBox

      public void writeFileTypeBox() throws IOException
      This method writes the File Type box
      Throws:
      IOException - If an I/O error ocurred.
    • writeJP2HeaderBox

      public void writeJP2HeaderBox() throws IOException
      This method writes the JP2Header box
      Throws:
      IOException - If an I/O error ocurred.
    • writeColourSpecificationBox

      public void writeColourSpecificationBox() throws IOException
      This method writes the Colour Specification box
      Throws:
      IOException - If an I/O error ocurred.
    • writeImageHeaderBox

      public void writeImageHeaderBox() throws IOException
      This method writes the Image Header box
      Throws:
      IOException - If an I/O error ocurred.
    • writeContiguousCodeStreamBox

      public void writeContiguousCodeStreamBox(byte[] cs) throws IOException
      This method writes the Contiguous codestream box
      Parameters:
      cs - The contiguous codestream
      Throws:
      IOException - If an I/O error ocurred.