org.apache.sanselan.common
Class BinaryFileParser

java.lang.Object
  extended by org.apache.sanselan.common.BinaryFileFunctions
      extended by org.apache.sanselan.common.BinaryFileParser
All Implemented Interfaces:
BinaryConstants
Direct Known Subclasses:
ExifRewriter, IccProfileParser, ImageParser, IPTCParser, JpegRewriter, JpegUtils, JpegXmpParser, PNGChunk, ScanExpediter, Segment, TiffReader, TransparencyFilter

public class BinaryFileParser
extends BinaryFileFunctions


Field Summary
 
Fields inherited from class org.apache.sanselan.common.BinaryFileFunctions
debug
 
Fields inherited from interface org.apache.sanselan.common.BinaryConstants
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 Summary
BinaryFileParser()
           
BinaryFileParser(int byteOrder)
           
 
Method Summary
static boolean byteArrayHasPrefix(byte[] bytes, byte[] prefix)
           
protected  int convertByteArrayToInt(java.lang.String name, byte[] bytes)
           
protected  int convertByteArrayToInt(java.lang.String name, int start, byte[] bytes)
           
 int convertByteArrayToShort(java.lang.String name, byte[] bytes)
           
 int convertByteArrayToShort(java.lang.String name, int start, byte[] bytes)
           
protected  int getByteOrder()
           
protected  byte[] int2ToByteArray(int value)
           
 int read2Bytes(java.lang.String name, java.io.InputStream is, java.lang.String exception)
           
 int read3Bytes(java.lang.String name, java.io.InputStream is, java.lang.String exception)
           
 int read4Bytes(java.lang.String name, java.io.InputStream is, java.lang.String exception)
           
protected  void setByteOrder(int byteOrder)
           
protected  void setByteOrder(int a, int b)
           
 
Methods inherited from class org.apache.sanselan.common.BinaryFileFunctions
CharsToQuad, compareByteArrays, compareByteArrays, compareBytes, compareBytes, convertByteArrayToDouble, convertByteArrayToDouble, convertByteArrayToDoubleArray, convertByteArrayToFloat, convertByteArrayToFloat, convertByteArrayToFloatArray, convertByteArrayToInt, convertByteArrayToInt, convertByteArrayToIntArray, convertByteArrayToRational, convertByteArrayToRational, convertByteArrayToRationalArray, convertByteArrayToShort, convertByteArrayToShort, convertByteArrayToShortArray, convertDoubleArrayToByteArray, convertDoubleToByteArray, convertFloatArrayToByteArray, convertFloatToByteArray, convertIntArrayToByteArray, convertIntArrayToRationalArray, convertRationalArrayToByteArray, convertRationalToByteArray, convertShortArrayToByteArray, convertShortToByteArray, copyStreamToStream, debugByteArray, debugNumber, debugNumber, debugNumber, debugNumber, debugNumberArray, findNull, findNull, getBytearrayHead, getByteArrayTail, getDebug, getRAFBytes, getStreamBytes, head, int2ToByteArray, printByteBits, printCharQuad, printCharQuad, read2Bytes, read3Bytes, read4Bytes, readAndVerifyBytes, readAndVerifyBytes, readByte, readBytearray, readByteArray, readByteArray, readBytes, readRandomBytes, scanForByte, setDebug, skipBytes, skipBytes, slice, startsWith, tail, writeIntInToByteArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinaryFileParser

public BinaryFileParser(int byteOrder)

BinaryFileParser

public BinaryFileParser()
Method Detail

setByteOrder

protected void setByteOrder(int a,
                            int b)
                     throws ImageReadException,
                            java.io.IOException
Throws:
ImageReadException
java.io.IOException

setByteOrder

protected void setByteOrder(int byteOrder)

getByteOrder

protected int getByteOrder()

convertByteArrayToInt

protected final int convertByteArrayToInt(java.lang.String name,
                                          int start,
                                          byte[] bytes)

convertByteArrayToInt

protected final int convertByteArrayToInt(java.lang.String name,
                                          byte[] bytes)

convertByteArrayToShort

public final int convertByteArrayToShort(java.lang.String name,
                                         byte[] bytes)
                                  throws ImageReadException
Throws:
ImageReadException

convertByteArrayToShort

public final int convertByteArrayToShort(java.lang.String name,
                                         int start,
                                         byte[] bytes)
                                  throws ImageReadException
Throws:
ImageReadException

read4Bytes

public final int read4Bytes(java.lang.String name,
                            java.io.InputStream is,
                            java.lang.String exception)
                     throws ImageReadException,
                            java.io.IOException
Throws:
ImageReadException
java.io.IOException

read3Bytes

public final int read3Bytes(java.lang.String name,
                            java.io.InputStream is,
                            java.lang.String exception)
                     throws ImageReadException,
                            java.io.IOException
Throws:
ImageReadException
java.io.IOException

read2Bytes

public final int read2Bytes(java.lang.String name,
                            java.io.InputStream is,
                            java.lang.String exception)
                     throws ImageReadException,
                            java.io.IOException
Throws:
ImageReadException
java.io.IOException

byteArrayHasPrefix

public static boolean byteArrayHasPrefix(byte[] bytes,
                                         byte[] prefix)

int2ToByteArray

protected final byte[] int2ToByteArray(int value)


Copyright © 2007-2009. All Rights Reserved.