Class BEByteArrayInputStream

java.lang.Object
java.io.InputStream
java.io.ByteArrayInputStream
gov.nih.mipav.model.file.rawjp2.BEByteArrayInputStream
All Implemented Interfaces:
Closeable, AutoCloseable, jj2000.j2k.io.BinaryDataInput, jj2000.j2k.io.BinaryDataOutput, jj2000.j2k.io.RandomAccessIO

public class BEByteArrayInputStream extends ByteArrayInputStream implements jj2000.j2k.io.RandomAccessIO
Big Endian Input Array Stream, works as a replacement for BERandomAccessFile at the input of Jpeg2K decoder.
Author:
Dzung Nguyen
See Also:
  • Constructor Details

    • BEByteArrayInputStream

      public BEByteArrayInputStream(byte[] buf, int offset, int length)
    • BEByteArrayInputStream

      public BEByteArrayInputStream(byte[] buf)
  • Method Details

    • getPos

      public int getPos() throws IOException
      Specified by:
      getPos in interface jj2000.j2k.io.RandomAccessIO
      Throws:
      IOException
    • length

      public int length() throws IOException
      Specified by:
      length in interface jj2000.j2k.io.RandomAccessIO
      Throws:
      IOException
    • readFully

      public void readFully(byte[] b, int off, int len) throws IOException
      Specified by:
      readFully in interface jj2000.j2k.io.RandomAccessIO
      Throws:
      IOException
    • seek

      public void seek(int off) throws IOException
      Specified by:
      seek in interface jj2000.j2k.io.RandomAccessIO
      Throws:
      IOException
    • write

      public void write(int b) throws IOException
      Specified by:
      write in interface jj2000.j2k.io.RandomAccessIO
      Throws:
      IOException
    • getByteOrdering

      public int getByteOrdering()
      Specified by:
      getByteOrdering in interface jj2000.j2k.io.BinaryDataInput
      Specified by:
      getByteOrdering in interface jj2000.j2k.io.BinaryDataOutput
    • readByte

      public byte readByte() throws EOFException, IOException
      Specified by:
      readByte in interface jj2000.j2k.io.BinaryDataInput
      Throws:
      EOFException
      IOException
    • readDouble

      public double readDouble() throws EOFException, IOException
      Specified by:
      readDouble in interface jj2000.j2k.io.BinaryDataInput
      Throws:
      EOFException
      IOException
    • readFloat

      public float readFloat() throws EOFException, IOException
      Specified by:
      readFloat in interface jj2000.j2k.io.BinaryDataInput
      Throws:
      EOFException
      IOException
    • readInt

      public int readInt() throws EOFException, IOException
      Specified by:
      readInt in interface jj2000.j2k.io.BinaryDataInput
      Throws:
      EOFException
      IOException
    • readLong

      public long readLong() throws EOFException, IOException
      Specified by:
      readLong in interface jj2000.j2k.io.BinaryDataInput
      Throws:
      EOFException
      IOException
    • readShort

      public short readShort() throws EOFException, IOException
      Specified by:
      readShort in interface jj2000.j2k.io.BinaryDataInput
      Throws:
      EOFException
      IOException
    • readUnsignedByte

      public int readUnsignedByte() throws EOFException, IOException
      Specified by:
      readUnsignedByte in interface jj2000.j2k.io.BinaryDataInput
      Throws:
      EOFException
      IOException
    • readUnsignedInt

      public long readUnsignedInt() throws EOFException, IOException
      Specified by:
      readUnsignedInt in interface jj2000.j2k.io.BinaryDataInput
      Throws:
      EOFException
      IOException
    • readUnsignedShort

      public int readUnsignedShort() throws EOFException, IOException
      Specified by:
      readUnsignedShort in interface jj2000.j2k.io.BinaryDataInput
      Throws:
      EOFException
      IOException
    • skipBytes

      public int skipBytes(int n) throws EOFException, IOException
      Specified by:
      skipBytes in interface jj2000.j2k.io.BinaryDataInput
      Throws:
      EOFException
      IOException
    • flush

      public void flush() throws IOException
      Specified by:
      flush in interface jj2000.j2k.io.BinaryDataOutput
      Throws:
      IOException
    • writeByte

      public void writeByte(int v) throws IOException
      Specified by:
      writeByte in interface jj2000.j2k.io.BinaryDataOutput
      Throws:
      IOException
    • writeDouble

      public void writeDouble(double v) throws IOException
      Specified by:
      writeDouble in interface jj2000.j2k.io.BinaryDataOutput
      Throws:
      IOException
    • writeFloat

      public void writeFloat(float v) throws IOException
      Specified by:
      writeFloat in interface jj2000.j2k.io.BinaryDataOutput
      Throws:
      IOException
    • writeInt

      public void writeInt(int v) throws IOException
      Specified by:
      writeInt in interface jj2000.j2k.io.BinaryDataOutput
      Throws:
      IOException
    • writeLong

      public void writeLong(long v) throws IOException
      Specified by:
      writeLong in interface jj2000.j2k.io.BinaryDataOutput
      Throws:
      IOException
    • writeShort

      public void writeShort(int v) throws IOException
      Specified by:
      writeShort in interface jj2000.j2k.io.BinaryDataOutput
      Throws:
      IOException