public class TIFFInputStream extends InputStream
References:
TIFF TM Revision 6.0. Final — June 3, 1992. Adobe Systems Inc. http://www.exif.org/specifications.html
| Constructor and Description |
|---|
TIFFInputStream(ImageInputStream in) |
TIFFInputStream(ImageInputStream in,
ByteOrder byteOrder,
long firstIFDOffset)
Creates a TIFFInputStream from a stream which does not have a header.
|
| Modifier and Type | Method and Description |
|---|---|
ByteOrder |
getByteOrder() |
long |
getFirstIFDOffset() |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
int |
read(long offset,
byte[] b,
int off,
int len) |
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(ByteOrder newValue) |
available, close, mark, markSupported, read, reset, skippublic TIFFInputStream(ImageInputStream in) throws IOException
IOExceptionpublic TIFFInputStream(ImageInputStream in, ByteOrder byteOrder, long firstIFDOffset)
public ByteOrder getByteOrder()
public void setByteOrder(ByteOrder newValue)
public long getFirstIFDOffset()
public IFD readIFD(long offset) throws 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.
IOExceptionpublic IFD readIFD(long offset, boolean hasNextOffset, boolean isFirstIFD) throws 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.
IOExceptionpublic String readASCII(long offset, long length) throws IOException
IOExceptionpublic long readLONG(long offset)
throws IOException
IOExceptionpublic long[] readLONG(long offset,
long count)
throws IOException
IOExceptionpublic int[] readSHORT(long offset,
long count)
throws IOException
IOExceptionpublic short[] readSSHORT(long offset,
long count)
throws IOException
IOExceptionpublic Rational readRATIONAL(long offset) throws IOException
IOExceptionpublic Rational readSRATIONAL(long offset) throws IOException
IOExceptionpublic Rational[] readRATIONAL(long offset, long count) throws IOException
IOExceptionpublic Rational[] readSRATIONAL(long offset, long count) throws IOException
IOExceptionpublic int read()
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamIOExceptionpublic int read(long offset,
byte[] b,
int off,
int len)
throws IOException
IOExceptionCopyright © 2014. All Rights Reserved.