public class BinaryInputStream extends InputStream implements BinaryConstants
Modifier and Type | Field and Description |
---|---|
protected boolean |
debug |
BYTE_ORDER_BIG_ENDIAN, BYTE_ORDER_INTEL, BYTE_ORDER_LEAST_SIGNIFICANT_BYTE, BYTE_ORDER_LITTLE_ENDIAN, BYTE_ORDER_LSB, BYTE_ORDER_MOST_SIGNIFICANT_BYTE, BYTE_ORDER_MOTOROLA, BYTE_ORDER_MSB, BYTE_ORDER_NETWORK
Constructor and Description |
---|
BinaryInputStream(byte[] bytes,
int byteOrder) |
BinaryInputStream(InputStream is) |
BinaryInputStream(InputStream is,
int byteOrder) |
Modifier and Type | Method and Description |
---|---|
protected static int |
CharsToQuad(char c1,
char c2,
char c3,
char c4) |
boolean |
compareByteArrays(byte[] a,
int aStart,
byte[] b,
int bStart,
int length) |
protected int |
convertByteArrayToInt(String name,
byte[] bytes) |
protected int |
convertByteArrayToInt(String name,
byte[] bytes,
int byteOrder) |
protected int |
convertByteArrayToInt(String name,
byte[] bytes,
int start,
int length,
int byteOrder) |
protected int[] |
convertByteArrayToIntArray(String name,
byte[] bytes,
int start,
int length,
int byteOrder) |
protected RationalNumber |
convertByteArrayToRational(String name,
byte[] bytes,
int byteOrder) |
protected RationalNumber |
convertByteArrayToRational(String name,
byte[] bytes,
int start,
int byteOrder) |
protected RationalNumber[] |
convertByteArrayToRationalArray(String name,
byte[] bytes,
int start,
int length,
int byteOrder) |
int |
convertByteArrayToShort(String name,
byte[] bytes) |
protected int |
convertByteArrayToShort(String name,
byte[] bytes,
int byteOrder) |
int |
convertByteArrayToShort(String name,
int start,
byte[] bytes) |
protected int |
convertByteArrayToShort(String name,
int start,
byte[] bytes,
int byteOrder) |
protected int[] |
convertByteArrayToShortArray(String name,
byte[] bytes,
int start,
int length,
int byteOrder) |
protected void |
debugByteArray(String name,
byte[] bytes) |
void |
debugNumber(String msg,
int data) |
void |
debugNumber(String msg,
int data,
int bytes) |
protected void |
debugNumberArray(String name,
int[] numbers,
int length) |
int |
findNull(byte[] src) |
int |
findNull(byte[] src,
int start) |
protected byte[] |
getBytearrayHead(String name,
byte[] bytes,
int count) |
protected byte[] |
getBytearrayTail(String name,
byte[] bytes,
int count) |
protected int |
getByteOrder() |
boolean |
getDebug() |
protected byte[] |
getRAFBytes(RandomAccessFile raf,
long pos,
int length,
String exception) |
protected void |
printByteBits(String msg,
byte i) |
protected void |
printCharQuad(String msg,
int i) |
int |
read() |
int |
read1ByteInteger(String exception) |
int |
read2ByteInteger(String exception) |
int |
read2Bytes(String name,
String exception) |
protected int |
read2Bytes(String name,
String exception,
int byteOrder) |
int |
read3Bytes(String name,
String exception) |
protected int |
read3Bytes(String name,
String exception,
int byteOrder) |
int |
read4ByteInteger(String exception) |
int |
read4Bytes(String name,
String exception) |
protected int |
read4Bytes(String name,
String exception,
int byteOrder) |
void |
readAndVerifyBytes(byte[] expected,
String exception) |
protected void |
readAndVerifyBytes(String name,
byte[] expected,
String exception) |
byte |
readByte(String name,
String exception) |
byte[] |
readByteArray(int length,
String error) |
byte[] |
readByteArray(int length,
String error,
boolean verbose,
boolean strict) |
byte[] |
readBytearray(String name,
byte[] bytes,
int start,
int count) |
byte[] |
readByteArray(String name,
int length,
String exception) |
protected void |
readRandomBytes() |
protected void |
scanForByte(byte value) |
protected void |
setByteOrder(int byteOrder) |
protected void |
setByteOrder(int a,
int b) |
void |
setDebug(boolean b) |
protected void |
skipBytes(int length) |
void |
skipBytes(int length,
String exception) |
available, close, mark, markSupported, read, read, reset, skip
public BinaryInputStream(byte[] bytes, int byteOrder)
public BinaryInputStream(InputStream is, int byteOrder)
public BinaryInputStream(InputStream is)
public final void setDebug(boolean b)
public final boolean getDebug()
protected void setByteOrder(int a, int b) throws ImageReadException, IOException
ImageReadException
IOException
protected void setByteOrder(int byteOrder)
protected int getByteOrder()
public int read() throws IOException
read
in class InputStream
IOException
protected final int convertByteArrayToInt(String name, byte[] bytes)
public final int convertByteArrayToShort(String name, byte[] bytes)
public final int convertByteArrayToShort(String name, int start, byte[] bytes)
public final int read4Bytes(String name, String exception) throws ImageReadException, IOException
ImageReadException
IOException
public final int read3Bytes(String name, String exception) throws ImageReadException, IOException
ImageReadException
IOException
public final int read2Bytes(String name, String exception) throws ImageReadException, IOException
ImageReadException
IOException
protected final void readRandomBytes() throws ImageReadException, IOException
ImageReadException
IOException
public final void debugNumber(String msg, int data)
public final void debugNumber(String msg, int data, int bytes)
public final void readAndVerifyBytes(byte[] expected, String exception) throws ImageReadException, IOException
ImageReadException
IOException
protected final void readAndVerifyBytes(String name, byte[] expected, String exception) throws ImageReadException, IOException
ImageReadException
IOException
public final void skipBytes(int length, String exception) throws IOException
IOException
protected final void scanForByte(byte value) throws IOException
IOException
public final byte readByte(String name, String exception) throws IOException
IOException
protected final RationalNumber[] convertByteArrayToRationalArray(String name, byte[] bytes, int start, int length, int byteOrder)
protected final RationalNumber convertByteArrayToRational(String name, byte[] bytes, int byteOrder)
protected final RationalNumber convertByteArrayToRational(String name, byte[] bytes, int start, int byteOrder)
protected final int convertByteArrayToInt(String name, byte[] bytes, int byteOrder)
protected final int convertByteArrayToInt(String name, byte[] bytes, int start, int length, int byteOrder)
protected final int[] convertByteArrayToIntArray(String name, byte[] bytes, int start, int length, int byteOrder)
protected final int convertByteArrayToShort(String name, byte[] bytes, int byteOrder)
protected final int convertByteArrayToShort(String name, int start, byte[] bytes, int byteOrder)
protected final int[] convertByteArrayToShortArray(String name, byte[] bytes, int start, int length, int byteOrder)
public final byte[] readByteArray(String name, int length, String exception) throws ImageReadException, IOException
ImageReadException
IOException
protected final void debugByteArray(String name, byte[] bytes)
protected final void debugNumberArray(String name, int[] numbers, int length)
public final byte[] readBytearray(String name, byte[] bytes, int start, int count)
public final byte[] readByteArray(int length, String error) throws ImageReadException, IOException
ImageReadException
IOException
public final byte[] readByteArray(int length, String error, boolean verbose, boolean strict) throws ImageReadException, IOException
ImageReadException
IOException
protected final byte[] getBytearrayTail(String name, byte[] bytes, int count)
protected final byte[] getBytearrayHead(String name, byte[] bytes, int count)
public final boolean compareByteArrays(byte[] a, int aStart, byte[] b, int bStart, int length)
protected final int read4Bytes(String name, String exception, int byteOrder) throws ImageReadException, IOException
ImageReadException
IOException
protected final int read3Bytes(String name, String exception, int byteOrder) throws ImageReadException, IOException
ImageReadException
IOException
protected final int read2Bytes(String name, String exception, int byteOrder) throws ImageReadException, IOException
ImageReadException
IOException
public final int read1ByteInteger(String exception) throws ImageReadException, IOException
ImageReadException
IOException
public final int read2ByteInteger(String exception) throws ImageReadException, IOException
ImageReadException
IOException
public final int read4ByteInteger(String exception) throws ImageReadException, IOException
ImageReadException
IOException
protected final void printCharQuad(String msg, int i)
protected final void printByteBits(String msg, byte i)
protected static final int CharsToQuad(char c1, char c2, char c3, char c4)
public final int findNull(byte[] src)
public final int findNull(byte[] src, int start)
protected final byte[] getRAFBytes(RandomAccessFile raf, long pos, int length, String exception) throws IOException
IOException
protected void skipBytes(int length) throws IOException
IOException
Copyright © 2007-2012. All Rights Reserved.