public class TIFFInputStream
extends java.io.InputStream
References:
TIFF TM Revision 6.0. Final — June 3, 1992. Adobe Systems Inc. http://www.exif.org/specifications.html
| Constructor and Description |
|---|
TIFFInputStream(javax.imageio.stream.ImageInputStream in) |
TIFFInputStream(javax.imageio.stream.ImageInputStream in,
java.nio.ByteOrder byteOrder,
long firstIFDOffset)
Creates a TIFFInputStream from a stream which does not have a header.
|
| Modifier and Type | Method and Description |
|---|---|
java.nio.ByteOrder |
getByteOrder() |
long |
getFirstIFDOffset() |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
int |
read(long offset,
byte[] b,
int off,
int len) |
java.lang.String |
readASCII(long offset,
long length)
Reads an ASCII (8-bit byte that contains a 7-bit ASCII code; the last byte
must be NUL (binary zero).
|
IFD |
readIFD(long offset)
Reads the IFD at the specified offset.
|
IFD |
readIFD(long offset,
boolean hasNextOffset,
boolean isFirstIFD)
Reads the IFD at the specified offset.
|
long |
readLONG(long offset)
Reads a LONG (32-bit (4-byte) unsigned integer).
|
long[] |
readLONG(long offset,
long count)
Reads the specified number of LONGs (32-bit (4-byte) unsigned integer).
|
Rational |
readRATIONAL(long offset)
Reads a RATIONAL number at the specified offset.
|
Rational[] |
readRATIONAL(long offset,
long count)
Reads the specified number of RATIONALs at the specified offset.
|
int[] |
readSHORT(long offset,
long count)
Reads the specified number of SHORTs (16-bit (2-byte) unsigned integer).
|
Rational |
readSRATIONAL(long offset)
Reads a RATIONAL number at the specified offset.
|
Rational[] |
readSRATIONAL(long offset,
long count)
Reads the specified number of RATIONALs at the specified offset.
|
short[] |
readSSHORT(long offset,
long count)
Reads the specified number of SSHORTs (16-bit (2-byte) signed integer).
|
void |
setByteOrder(java.nio.ByteOrder newValue) |
public TIFFInputStream(javax.imageio.stream.ImageInputStream in)
throws java.io.IOException
java.io.IOExceptionpublic TIFFInputStream(javax.imageio.stream.ImageInputStream in,
java.nio.ByteOrder byteOrder,
long firstIFDOffset)
public java.nio.ByteOrder getByteOrder()
public void setByteOrder(java.nio.ByteOrder newValue)
public long getFirstIFDOffset()
public IFD readIFD(long offset) throws java.io.IOException
An IFD consists of a 2-byte count of the number of directory entries (i.e., the number of fields), followed by a sequence of 12-byte field entries, followed by a 4-byte offset of the next IFD (or 0 if none).
Each 12-byte IFD entry has the following format: Bytes 0-1 The Tag that identifies the field. Bytes 2-3 The field Type. Bytes 4-7 The number of values, Count of the indicated Type. Bytes 8-11 The Value Offset, the file offset (in bytes) of the Value for the field. The Value is expected to begin on a word boundary; the corresponding Value Offset will thus be an even number. This file offset may point anywhere in the file, even after the image data.
There must be at least 1 IFD in a TIFF file and each IFD must have at least one entry.
java.io.IOExceptionpublic IFD readIFD(long offset, boolean hasNextOffset, boolean isFirstIFD) throws java.io.IOException
An IFD consists of a 2-byte count of the number of directory entries (i.e., the number of fields), followed by a sequence of 12-byte field entries, followed by a 4-byte offset of the next IFD (or 0 if none).
Each 12-byte IFD entry has the following format: Bytes 0-1 The Tag that identifies the field. Bytes 2-3 The field Type. Bytes 4-7 The number of values, Count of the indicated Type. Bytes 8-11 The Value Offset, the file offset (in bytes) of the Value for the field. The Value is expected to begin on a word boundary; the corresponding Value Offset will thus be an even number. This file offset may point anywhere in the file, even after the image data.
There must be at least 1 IFD in a TIFF file and each IFD must have at least one entry.
java.io.IOExceptionpublic java.lang.String readASCII(long offset,
long length)
throws java.io.IOException
java.io.IOExceptionpublic long readLONG(long offset)
throws java.io.IOException
java.io.IOExceptionpublic long[] readLONG(long offset,
long count)
throws java.io.IOException
java.io.IOExceptionpublic int[] readSHORT(long offset,
long count)
throws java.io.IOException
java.io.IOExceptionpublic short[] readSSHORT(long offset,
long count)
throws java.io.IOException
java.io.IOExceptionpublic Rational readRATIONAL(long offset) throws java.io.IOException
java.io.IOExceptionpublic Rational readSRATIONAL(long offset) throws java.io.IOException
java.io.IOExceptionpublic Rational[] readRATIONAL(long offset, long count) throws java.io.IOException
java.io.IOExceptionpublic Rational[] readSRATIONAL(long offset, long count) throws java.io.IOException
java.io.IOExceptionpublic int read()
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic int read(byte[] b,
int off,
int len)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic int read(long offset,
byte[] b,
int off,
int len)
throws java.io.IOException
java.io.IOException