|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrebuild.graphics.tiff.Writer
public final class Writer
A data type writer for TIFF.
Field Summary | |
---|---|
static short |
ASCII
8-bit byte that contains a 7-bit ASCII code; the last byte must be NUL (binary zero), the last byte is taken care of by the Writer . |
static short |
BYTE
8-bit unsigned integer. |
static short |
DOUBLE
Double precision (8-byte) IEEE format. |
static short |
FLOAT
Single precision (4-byte) IEEE format. |
static short |
LONG
32-bit (4-byte) unsigned integer. |
static short |
LONG8
A 64-bit (8-byte) unsigned integer. |
static short |
RATIONAL
Two LONG s: the first represents the numerator of a fraction; the second, the denominator. |
static short |
SBYTE
An 8-bit signed (twos-complement) integer. |
static short |
SHORT
16-bit (2-byte) unsigned integer. |
static short |
SLONG
A 32-bit (4-byte) signed (twos-complement) integer. |
static short |
SLONG8
A 64-bit (8-byte) signed (twos-complement) integer. |
static short |
SRATIONAL
Two SLONG ’s: the first represents the numerator of a fraction, the second the denominator. |
static short |
SSHORT
A 16-bit (2-byte) signed (twos-complement) integer. |
static short |
UNDEFINED
An 8-bit byte that may contain anything, depending on the definition of the field. |
Constructor Summary | |
---|---|
Writer(boolean littleEndian,
java.io.OutputStream out)
Create a new Writer. |
Method Summary | |
---|---|
boolean |
getLittleEndian()
Get if the encoder is in little-endian format. |
static long |
shiftValue(byte value,
int pos)
Shift a value so it is in a format that the Writer can write out. |
static long |
shiftValue(int value,
int pos)
Shift a value so it is in a format that the Writer can write out. |
static long |
shiftValue(short value,
int pos)
Shift a value so it is in a format that the Writer can write out. |
static byte |
unshiftByte(long value,
int pos)
Unshift a value so it is in a format that is useable. |
static int |
unshiftInt(long value,
int pos)
Unshift a value so it is in a format that is useable. |
static short |
unshiftShort(long value,
int pos)
Unshift a value so it is in a format that is useable. |
void |
write(byte[] data)
Write an array of bytes to the stream. |
void |
write(byte[] data,
int off,
int len)
Write an array of bytes to the stream. |
void |
writeASCII(char value)
Write a 7-bit ASCII code. |
void |
writeASCII(java.lang.String value)
Write a ASCII string. |
void |
writeASCII(java.lang.String[] values)
Write an array of ASCII strings. |
void |
writeByte(int value)
Write a BYTE or SBYTE . |
void |
writeDouble(double value)
Write a DOUBLE . |
void |
writeFloat(float value)
Write a FLOAT . |
void |
writeTagLongValue(long value,
boolean offset,
short type)
Write the Tag 's value to the stream as a 8byte int. |
void |
writeTagValue(int value,
boolean offset,
short type)
Write the Tag 's value to the stream. |
void |
writeUInt(int value)
Write a LONG or SLONG . |
void |
writeULong(long value)
Write a 8-byte signed/unsigned integer. |
void |
writeURational(int numerator,
int denominator)
Write a RATIONAL or SRATIONAL . |
void |
writeUShort(int value)
Write a SHORT or SSHORT . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final short BYTE
public static final short ASCII
Writer
.
public static final short SHORT
public static final short LONG
public static final short RATIONAL
LONG
s: the first represents the numerator of a fraction; the second, the denominator.
public static final short SBYTE
public static final short UNDEFINED
public static final short SSHORT
public static final short SLONG
public static final short SRATIONAL
SLONG
’s: the first represents the numerator of a fraction, the second the denominator.
public static final short FLOAT
public static final short DOUBLE
public static final short LONG8
public static final short SLONG8
Constructor Detail |
---|
public Writer(boolean littleEndian, java.io.OutputStream out)
littleEndian
- If the stream should be little-endian (true) or big-endian (false).out
- The stream to write data to.Method Detail |
---|
public void write(byte[] data) throws java.io.IOException
data
- The array of bytes to write.
java.io.IOException
- If any IO exception occurs.public void write(byte[] data, int off, int len) throws java.io.IOException
data
- The array of bytes to write.off
- The start offset in the data.len
- The number of bytes to write.
java.io.IOException
- If any IO exception occurs.public void writeByte(int value) throws java.io.IOException
BYTE
or SBYTE
.
value
- The BYTE
/SBYTE
to write.
java.io.IOException
- If any IO exception occurs.public void writeUShort(int value) throws java.io.IOException
SHORT
or SSHORT
.
value
- The SHORT
/SSHORT
to write.
java.io.IOException
- If any IO exception occurs.public void writeUInt(int value) throws java.io.IOException
LONG
or SLONG
.
value
- The LONG
/SLONG
to write.
java.io.IOException
- If any IO exception occurs.public void writeFloat(float value) throws java.io.IOException
FLOAT
.
value
- The FLOAT
to write.
java.io.IOException
- If any IO exception occurs.public void writeULong(long value) throws java.io.IOException
value
- The 8-byte signed/unsigned integer to write.
java.io.IOException
- If any IO exception occurs.public void writeDouble(double value) throws java.io.IOException
DOUBLE
.
value
- The DOUBLE
to write.
java.io.IOException
- If any IO exception occurs.public void writeURational(int numerator, int denominator) throws java.io.IOException
RATIONAL
or SRATIONAL
.
numerator
- The numerator to write.denominator
- The denominator to write.
java.io.IOException
- If any IO exception occurs.public void writeASCII(char value) throws java.io.IOException
value
- The 7-bit ASCII code to write.
java.io.IOException
- If any IO exception occurs.public void writeASCII(java.lang.String value) throws java.io.IOException
ASCII
string.
value
- The ASCII
string to write.
java.io.IOException
- If any IO exception occurs.public void writeASCII(java.lang.String[] values) throws java.io.IOException
ASCII
strings.
values
- The array of ASCII
strings to write.
java.io.IOException
- If any IO exception occurs.public boolean getLittleEndian()
public void writeTagValue(int value, boolean offset, short type) throws java.io.IOException
Tag
's value to the stream.
value
- The Tag
's value.offset
- If the value is an offset.type
- The data type the value is.
java.io.IOException
public void writeTagLongValue(long value, boolean offset, short type) throws java.io.IOException
Tag
's value to the stream as a 8byte int.
value
- The Tag
's value 8byte value.offset
- If the value is an offset.type
- The data type the value is.
java.io.IOException
public static long shiftValue(int value, int pos)
Writer
can write out.
value
- The value to shift.pos
- The position it should be in the value (0-1).
public static long shiftValue(short value, int pos)
Writer
can write out.
value
- The value to shift.pos
- The position it should be in the value (0-3).
public static long shiftValue(byte value, int pos)
Writer
can write out.
value
- The value to shift.pos
- The position it should be in the value (0-7).
public static int unshiftInt(long value, int pos)
value
- The value to "unshift."pos
- The position it is in the value (0-1).
public static short unshiftShort(long value, int pos)
value
- The value to "unshift."pos
- The position it is in the value (0-3).
public static byte unshiftByte(long value, int pos)
value
- The value to "unshift."pos
- The position it is in the value (0-7).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |