Package gov.nih.mipav.model.file.rawjp2
Class BEByteArrayInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.ByteArrayInputStream
-
- gov.nih.mipav.model.file.rawjp2.BEByteArrayInputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,jj2000.j2k.io.BinaryDataInput
,jj2000.j2k.io.BinaryDataOutput
,jj2000.j2k.io.RandomAccessIO
public class BEByteArrayInputStream extends java.io.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:
RandomAccessIO
,ByteArrayInputStream
-
-
Constructor Summary
Constructors Constructor Description BEByteArrayInputStream(byte[] buf)
BEByteArrayInputStream(byte[] buf, int offset, int length)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
flush()
int
getByteOrdering()
int
getPos()
int
length()
byte
readByte()
double
readDouble()
float
readFloat()
void
readFully(byte[] b, int off, int len)
int
readInt()
long
readLong()
short
readShort()
int
readUnsignedByte()
long
readUnsignedInt()
int
readUnsignedShort()
void
seek(int off)
int
skipBytes(int n)
void
write(int b)
void
writeByte(int v)
void
writeDouble(double v)
void
writeFloat(float v)
void
writeInt(int v)
void
writeLong(long v)
void
writeShort(int v)
-
Methods inherited from class java.io.ByteArrayInputStream
available, close, mark, markSupported, read, read, readAllBytes, readNBytes, reset, skip, transferTo
-
-
-
-
Method Detail
-
getPos
public int getPos() throws java.io.IOException
- Specified by:
getPos
in interfacejj2000.j2k.io.RandomAccessIO
- Throws:
java.io.IOException
-
length
public int length() throws java.io.IOException
- Specified by:
length
in interfacejj2000.j2k.io.RandomAccessIO
- Throws:
java.io.IOException
-
readFully
public void readFully(byte[] b, int off, int len) throws java.io.IOException
- Specified by:
readFully
in interfacejj2000.j2k.io.RandomAccessIO
- Throws:
java.io.IOException
-
seek
public void seek(int off) throws java.io.IOException
- Specified by:
seek
in interfacejj2000.j2k.io.RandomAccessIO
- Throws:
java.io.IOException
-
write
public void write(int b) throws java.io.IOException
- Specified by:
write
in interfacejj2000.j2k.io.RandomAccessIO
- Throws:
java.io.IOException
-
getByteOrdering
public int getByteOrdering()
- Specified by:
getByteOrdering
in interfacejj2000.j2k.io.BinaryDataInput
- Specified by:
getByteOrdering
in interfacejj2000.j2k.io.BinaryDataOutput
-
readByte
public byte readByte() throws java.io.EOFException, java.io.IOException
- Specified by:
readByte
in interfacejj2000.j2k.io.BinaryDataInput
- Throws:
java.io.EOFException
java.io.IOException
-
readDouble
public double readDouble() throws java.io.EOFException, java.io.IOException
- Specified by:
readDouble
in interfacejj2000.j2k.io.BinaryDataInput
- Throws:
java.io.EOFException
java.io.IOException
-
readFloat
public float readFloat() throws java.io.EOFException, java.io.IOException
- Specified by:
readFloat
in interfacejj2000.j2k.io.BinaryDataInput
- Throws:
java.io.EOFException
java.io.IOException
-
readInt
public int readInt() throws java.io.EOFException, java.io.IOException
- Specified by:
readInt
in interfacejj2000.j2k.io.BinaryDataInput
- Throws:
java.io.EOFException
java.io.IOException
-
readLong
public long readLong() throws java.io.EOFException, java.io.IOException
- Specified by:
readLong
in interfacejj2000.j2k.io.BinaryDataInput
- Throws:
java.io.EOFException
java.io.IOException
-
readShort
public short readShort() throws java.io.EOFException, java.io.IOException
- Specified by:
readShort
in interfacejj2000.j2k.io.BinaryDataInput
- Throws:
java.io.EOFException
java.io.IOException
-
readUnsignedByte
public int readUnsignedByte() throws java.io.EOFException, java.io.IOException
- Specified by:
readUnsignedByte
in interfacejj2000.j2k.io.BinaryDataInput
- Throws:
java.io.EOFException
java.io.IOException
-
readUnsignedInt
public long readUnsignedInt() throws java.io.EOFException, java.io.IOException
- Specified by:
readUnsignedInt
in interfacejj2000.j2k.io.BinaryDataInput
- Throws:
java.io.EOFException
java.io.IOException
-
readUnsignedShort
public int readUnsignedShort() throws java.io.EOFException, java.io.IOException
- Specified by:
readUnsignedShort
in interfacejj2000.j2k.io.BinaryDataInput
- Throws:
java.io.EOFException
java.io.IOException
-
skipBytes
public int skipBytes(int n) throws java.io.EOFException, java.io.IOException
- Specified by:
skipBytes
in interfacejj2000.j2k.io.BinaryDataInput
- Throws:
java.io.EOFException
java.io.IOException
-
flush
public void flush() throws java.io.IOException
- Specified by:
flush
in interfacejj2000.j2k.io.BinaryDataOutput
- Throws:
java.io.IOException
-
writeByte
public void writeByte(int v) throws java.io.IOException
- Specified by:
writeByte
in interfacejj2000.j2k.io.BinaryDataOutput
- Throws:
java.io.IOException
-
writeDouble
public void writeDouble(double v) throws java.io.IOException
- Specified by:
writeDouble
in interfacejj2000.j2k.io.BinaryDataOutput
- Throws:
java.io.IOException
-
writeFloat
public void writeFloat(float v) throws java.io.IOException
- Specified by:
writeFloat
in interfacejj2000.j2k.io.BinaryDataOutput
- Throws:
java.io.IOException
-
writeInt
public void writeInt(int v) throws java.io.IOException
- Specified by:
writeInt
in interfacejj2000.j2k.io.BinaryDataOutput
- Throws:
java.io.IOException
-
writeLong
public void writeLong(long v) throws java.io.IOException
- Specified by:
writeLong
in interfacejj2000.j2k.io.BinaryDataOutput
- Throws:
java.io.IOException
-
writeShort
public void writeShort(int v) throws java.io.IOException
- Specified by:
writeShort
in interfacejj2000.j2k.io.BinaryDataOutput
- Throws:
java.io.IOException
-
-