Packages

 

com.aspose.cad.fileformats.tiff.filemanagement

Class TiffStreamReader

  • java.lang.Object
    • com.aspose.cad.fileformats.tiff.filemanagement.TiffStreamReader


  • public class TiffStreamReader
    extends Object

    The tiff stream for handling little endian tiff file format.

    • Constructor Summary

      Constructors 
      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.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      long getLength()
      Gets the reader length.
      boolean getThrowExceptions()
      Gets or sets a value indicating whether cadexceptions 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 cadexceptions are thrown on incorrect data processing (reading or writing to stream).
      StreamContainer toStreamContainer(long startPosition)
      Converts the underlying data to the stream container.
    • Constructor Detail

      • TiffStreamReader

        public TiffStreamReader(byte[] data)

        Initializes a new instance of the TiffStreamReader class.

        Parameters:
        data - The byte array data.
      • TiffStreamReader

        public TiffStreamReader(byte[] data,
                                int startIndex)

        Initializes a new instance of the TiffStreamReader class.

        Parameters:
        data - The byte array data.
        startIndex - The start index into data.
      • TiffStreamReader

        public TiffStreamReader(byte[] data,
                                int startIndex,
                                int dataLength)

        Initializes a new instance of the TiffStreamReader class.

        Parameters:
        data - The byte array data.
        startIndex - The start index into data.
        dataLength - Length of the data.
      • TiffStreamReader

        public TiffStreamReader(StreamContainer streamContainer)

        Initializes a new instance of the TiffStreamReader class.

        Parameters:
        streamContainer - The stream container.
    • Method Detail

      • getLength

        public long getLength()

        Gets the reader length.

        Value: The reader length.
      • getThrowExceptions

        public boolean getThrowExceptions()

        Gets or sets a value indicating whether cadexceptions are thrown on incorrect data processing (reading or writing to stream).

        Value: true if cadexceptions are thrown on incorrect data processing; otherwise, the error conditions are silently ignored.
      • setThrowExceptions

        public void setThrowExceptions(boolean value)

        Gets or sets a value indicating whether cadexceptions are thrown on incorrect data processing (reading or writing to stream).

        Value: true if cadexceptions are thrown on incorrect data processing; otherwise, the error conditions are silently ignored.
      • readBytes

        public long readBytes(byte[] array,
                              int arrayIndex,
                              long position,
                              long count)

        Reads an array of byte values from the stream.

        Parameters:
        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.
        Returns:
        The array of byte values.
      • readBytes

        public byte[] readBytes(long position,
                                long count)

        Reads an array of unsigned byte values from the stream.

        Parameters:
        position - The position to read from.
        count - The elements count.
        Returns:
        The array of unsigned byte values.
      • readDouble

        public double readDouble(long position)

        Read a single double value from the stream.

        Parameters:
        position - The position to read from.
        Returns:
        The single double value.
      • readDoubleArray

        public double[] readDoubleArray(long position,
                                        long count)

        Reads an array of double values from the stream.

        Parameters:
        position - The position to read from.
        count - The elements count.
        Returns:
        The array of double values.
      • readFloat

        public float readFloat(long position)

        Read a single float value from the stream.

        Parameters:
        position - The position to read from.
        Returns:
        The single float value.
      • readFloatArray

        public float[] readFloatArray(long position,
                                      long count)

        Reads an array of float values from the stream.

        Parameters:
        position - The position to read from.
        count - The elements count.
        Returns:
        The array of float values.
        Throws:
        com.aspose.ms.System.ArgumentOutOfRangeException - count;Expected a positive number.
      • readRational

        public TiffRational readRational(long position)

        Read a single rational number value from the stream.

        Parameters:
        position - The position to read from.
        Returns:
        The rational number.
      • readSRational

        public TiffSRational readSRational(long position)

        Read a single signed rational number value from the stream.

        Parameters:
        position - The position to read from.
        Returns:
        The signed rational number.
      • readRationalArray

        public TiffRational[] readRationalArray(long position,
                                                long count)

        Reads an array of rational values from the stream.

        Parameters:
        position - The position to read from.
        count - The elements count.
        Returns:
        The array of rational values.
        Throws:
        com.aspose.ms.System.ArgumentOutOfRangeException - count;Expected a positive number.
      • readSRationalArray

        public TiffSRational[] readSRationalArray(long position,
                                                  long count)

        Reads an array of signed rational values from the stream.

        Parameters:
        position - The position to read from.
        count - The elements count.
        Returns:
        The array of signed rational values.
        Throws:
        com.aspose.ms.System.ArgumentOutOfRangeException - count;Expected a positive number.
      • readSByte

        public byte readSByte(long position)

        Reads signed byte data from the stream.

        Parameters:
        position - The position to read from.
        Returns:
        The signed byte value.
      • readSByteArray

        public byte[] readSByteArray(long position,
                                     long count)

        Reads an array of signed byte values from the stream.

        Parameters:
        position - The position to read from.
        count - The elements count.
        Returns:
        The array of signed byte values.
      • readSLong

        public int readSLong(long position)

        Read signed integer value from the stream.

        Parameters:
        position - The position to read from.
        Returns:
        A signed integer value.
      • readSLongArray

        public int[] readSLongArray(long position,
                                    long count)

        Reads an array of signed integer values from the stream.

        Parameters:
        position - The position to read from.
        count - The elements count.
        Returns:
        The array of signed integer values.
        Throws:
        com.aspose.ms.System.ArgumentOutOfRangeException - count;Total bytes count is negative. + count + x4= + totalBytes
      • readSShort

        public short readSShort(long position)

        Read signed short value from the stream.

        Parameters:
        position - The position to read from.
        Returns:
        A signed short value.
      • readSShortArray

        public short[] readSShortArray(long position,
                                       long count)

        Reads an array of signed short values from the stream.

        Parameters:
        position - The position to read from.
        count - The elements count.
        Returns:
        The array of signed short values.
        Throws:
        com.aspose.ms.System.ArgumentOutOfRangeException - count;Expected a positive number.
      • readULong

        public long readULong(long position)

        Read unsigned integer value from the stream.

        Parameters:
        position - The position to read from.
        Returns:
        An unsigned integer value.
      • readULongArray

        public long[] readULongArray(long position,
                                     long count)

        Reads an array of unsigned integer values from the stream.

        Parameters:
        position - The position to read from.
        count - The elements count.
        Returns:
        The array of unsigned integer values.
        Throws:
        com.aspose.ms.System.ArgumentOutOfRangeException - count;Total bytes count is negative. + count + x4= + totalBytes
      • readUShort

        public int readUShort(long position)

        Read unsigned short value from the stream.

        Parameters:
        position - The position to read from.
        Returns:
        An unsigned short value.
      • readUShortArray

        public int[] readUShortArray(long position,
                                     long count)

        Reads an array of unsigned integer values from the stream.

        Parameters:
        position - The position to read from.
        count - The elements count.
        Returns:
        The array of unsigned integer values.
        Throws:
        com.aspose.ms.System.ArgumentOutOfRangeException - count;Total bytes count is negative. + count + x2= + totalBytes
      • toStreamContainer

        public StreamContainer toStreamContainer(long startPosition)

        Converts the underlying data to the stream container.

        Parameters:
        startPosition - The start position to start conversion from.
        Returns:
        The StreamContainer with converted data.