public class TiffStreamReader extends Object
The tiff stream for handling little endian tiff file format.
Constructor and Description |
---|
TiffStreamReader(byte[] data)
Initializes a new instance of the
TiffStreamReader class. |
TiffStreamReader(byte[] data,
int startIndex)
Initializes a new instance of the
TiffStreamReader class. |
TiffStreamReader(byte[] data,
int startIndex,
int dataLength)
Initializes a new instance of the
TiffStreamReader class. |
TiffStreamReader(StreamContainer streamContainer)
Initializes a new instance of the
TiffStreamReader class. |
Modifier and Type | Method and Description |
---|---|
long |
getLength()
Gets the reader length.
|
boolean |
getThrowExceptions()
Gets or sets a value indicating whether exceptions are thrown on incorrect data processing (reading or writing to stream).
|
long |
readBytes(byte[] array,
int arrayIndex,
long position,
long count)
Reads an array of byte values from the stream.
|
byte[] |
readBytes(long position,
long count)
Reads an array of unsigned byte values from the stream.
|
double |
readDouble(long position)
Read a single double value from the stream.
|
double[] |
readDoubleArray(long position,
long count)
Reads an array of double values from the stream.
|
float |
readFloat(long position)
Read a single float value from the stream.
|
float[] |
readFloatArray(long position,
long count)
Reads an array of float values from the stream.
|
TiffRational |
readRational(long position)
Read a single rational number value from the stream.
|
TiffRational[] |
readRationalArray(long position,
long count)
Reads an array of rational values from the stream.
|
byte |
readSByte(long position)
Reads signed byte data from the stream.
|
byte[] |
readSByteArray(long position,
long count)
Reads an array of signed byte values from the stream.
|
int |
readSLong(long position)
Read signed integer value from the stream.
|
int[] |
readSLongArray(long position,
long count)
Reads an array of signed integer values from the stream.
|
TiffSRational |
readSRational(long position)
Read a single signed rational number value from the stream.
|
TiffSRational[] |
readSRationalArray(long position,
long count)
Reads an array of signed rational values from the stream.
|
short |
readSShort(long position)
Read signed short value from the stream.
|
short[] |
readSShortArray(long position,
long count)
Reads an array of signed short values from the stream.
|
long |
readULong(long position)
Read unsigned integer value from the stream.
|
long[] |
readULongArray(long position,
long count)
Reads an array of unsigned integer values from the stream.
|
int |
readUShort(long position)
Read unsigned short value from the stream.
|
int[] |
readUShortArray(long position,
long count)
Reads an array of unsigned integer values from the stream.
|
void |
setThrowExceptions(boolean value)
Gets or sets a value indicating whether exceptions are thrown on incorrect data processing (reading or writing to stream).
|
StreamContainer |
toStreamContainer(long startPosition)
Converts the underlying data to the stream container.
|
public TiffStreamReader(byte[] data)
Initializes a new instance of the TiffStreamReader
class.
data
- The byte array data.public TiffStreamReader(byte[] data, int startIndex)
Initializes a new instance of the TiffStreamReader
class.
data
- The byte array data.startIndex
- The start index into data
.public TiffStreamReader(byte[] data, int startIndex, int dataLength)
Initializes a new instance of the TiffStreamReader
class.
data
- The byte array data.startIndex
- The start index into data
.dataLength
- Length of the data.public TiffStreamReader(StreamContainer streamContainer)
Initializes a new instance of the TiffStreamReader
class.
streamContainer
- The stream container.public long getLength()
Gets the reader length.
Value: The reader length.public boolean getThrowExceptions()
Gets or sets a value indicating whether exceptions are thrown on incorrect data processing (reading or writing to stream).
Value:true
if exceptions are thrown on incorrect data processing; otherwise, the error conditions are silently ignored.public void setThrowExceptions(boolean value)
Gets or sets a value indicating whether exceptions are thrown on incorrect data processing (reading or writing to stream).
Value:true
if exceptions are thrown on incorrect data processing; otherwise, the error conditions are silently ignored.public long readBytes(byte[] array, int arrayIndex, long position, long count)
Reads an array of byte values from the stream.
array
- The array to fill.arrayIndex
- The array index to start putting values to.position
- The stream position to read from.count
- The elements count to read.public byte[] readBytes(long position, long count)
Reads an array of unsigned byte values from the stream.
position
- The position to read from.count
- The elements count.public double readDouble(long position)
Read a single double value from the stream.
position
- The position to read from.public double[] readDoubleArray(long position, long count)
Reads an array of double values from the stream.
position
- The position to read from.count
- The elements count.public float readFloat(long position)
Read a single float value from the stream.
position
- The position to read from.public float[] readFloatArray(long position, long count)
Reads an array of float values from the stream.
position
- The position to read from.count
- The elements count.com.aspose.ms.System.ArgumentOutOfRangeException
- count;Expected a positive number.public TiffRational readRational(long position)
Read a single rational number value from the stream.
position
- The position to read from.public TiffSRational readSRational(long position)
Read a single signed rational number value from the stream.
position
- The position to read from.public TiffRational[] readRationalArray(long position, long count)
Reads an array of rational values from the stream.
position
- The position to read from.count
- The elements count.com.aspose.ms.System.ArgumentOutOfRangeException
- count;Expected a positive number.public TiffSRational[] readSRationalArray(long position, long count)
Reads an array of signed rational values from the stream.
position
- The position to read from.count
- The elements count.com.aspose.ms.System.ArgumentOutOfRangeException
- count;Expected a positive number.public byte readSByte(long position)
Reads signed byte data from the stream.
position
- The position to read from.public byte[] readSByteArray(long position, long count)
Reads an array of signed byte values from the stream.
position
- The position to read from.count
- The elements count.public int readSLong(long position)
Read signed integer value from the stream.
position
- The position to read from.public int[] readSLongArray(long position, long count)
Reads an array of signed integer values from the stream.
position
- The position to read from.count
- The elements count.com.aspose.ms.System.ArgumentOutOfRangeException
- count;Total bytes count is negative. + count + x4= + totalBytespublic short readSShort(long position)
Read signed short value from the stream.
position
- The position to read from.public short[] readSShortArray(long position, long count)
Reads an array of signed short values from the stream.
position
- The position to read from.count
- The elements count.com.aspose.ms.System.ArgumentOutOfRangeException
- count;Expected a positive number.public long readULong(long position)
Read unsigned integer value from the stream.
position
- The position to read from.public long[] readULongArray(long position, long count)
Reads an array of unsigned integer values from the stream.
position
- The position to read from.count
- The elements count.com.aspose.ms.System.ArgumentOutOfRangeException
- count;Total bytes count is negative. + count + x4= + totalBytespublic int readUShort(long position)
Read unsigned short value from the stream.
position
- The position to read from.public int[] readUShortArray(long position, long count)
Reads an array of unsigned integer values from the stream.
position
- The position to read from.count
- The elements count.com.aspose.ms.System.ArgumentOutOfRangeException
- count;Total bytes count is negative. + count + x2= + totalBytespublic StreamContainer toStreamContainer(long startPosition)
Converts the underlying data to the stream container.
startPosition
- The start position to start conversion from.StreamContainer
with converted data.