ImageOutputStream interface.
This class is designed to reduce the number of methods that must
be implemented by subclasses.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected final void | flushBits()
If the bit offset is non-zero, forces the remaining bits in the current byte to 0 and advances the stream position by one. |
| public abstract void | write(int b)
Redeclares javax. Writes a single byte to the stream at the current position. |
| public void | write(byte[] b)
Implements javax. Writes a sequence of bytes to the stream at the current position. |
| public abstract void | write(byte[] b, int off, int len)
Redeclares javax. Writes a sequence of bytes to the stream at the current position. |
| public void | writeBit(int bit)
Implements javax. Writes a single bit, given by the least significant bit of the argument, to the stream at the current bit offset within the current byte position. |
| public void | writeBits(long bits, int numBits)
Implements javax. Writes a sequence of bits, given by the |
| public void | writeBoolean(boolean v)
Implements javax. Writes a |
| public void | writeByte(int v)
Implements javax. Writes the 8 low-order bits of |
| public void | writeBytes(String s)
Implements javax. Writes a string to the output stream. |
| public void | writeChar(int v)
Implements javax. This method is a synonym for |
| public void | writeChars(String s)
Implements javax. Writes a string to the output stream. |
| public void | writeChars(char[] c, int off, int len)
Implements javax. Writes a sequence of chars to the stream at the current position. |
| public void | writeDouble(double v)
Implements javax. Writes a |
| public void | writeDoubles(double[] d, int off, int len)
Implements javax. Writes a sequence of doubles to the stream at the current position. |
| public void | writeFloat(float v)
Implements javax. Writes a |
| public void | writeFloats(float[] f, int off, int len)
Implements javax. Writes a sequence of floats to the stream at the current position. |
| public void | writeInt(int v)
Implements javax. Writes the 32 bits of |
| public void | writeInts(int[] i, int off, int len)
Implements javax. Writes a sequence of ints to the stream at the current position. |
| public void | writeLong(long v)
Implements javax. Writes the 64 bits of |
| public void | writeLongs(long[] l, int off, int len)
Implements javax. Writes a sequence of longs to the stream at the current position. |
| public void | writeShort(int v)
Implements javax. Writes the 16 low-order bits of |
| public void | writeShorts(short[] s, int off, int len)
Implements javax. Writes a sequence of shorts to the stream at the current position. |
| public void | writeUTF(String s)
Implements javax. Writes two bytes of length information to the output stream in
network byte order, followed by the
modified UTF-8
representation of every character in the string |
| ImageOutputStreamImpl | back to summary |
|---|---|
| public ImageOutputStreamImpl() Constructs an | |
| flushBits | back to summary |
|---|---|
| protected final void flushBits() throws IOException If the bit offset is non-zero, forces the remaining bits
in the current byte to 0 and advances the stream position
by one. This method should be called by subclasses at the
beginning of the
| |
| write | back to summary |
|---|---|
| public abstract void write(int b) throws IOException Redeclares javax. Doc from javax. Writes a single byte to the stream at the current position.
The 24 high-order bits of If the bit offset within the stream is non-zero, the
remainder of the current byte is padded with 0s
and written out first. The bit offset will be 0 after the
write. Implementers can use the
| |
| write | back to summary |
|---|---|
| public void write(byte[] b) throws IOException Implements javax. Doc from javax. Writes a sequence of bytes to the stream at the current
position. If If the bit offset within the stream is non-zero, the remainder of the current byte is padded with 0s and written out first. The bit offset will be 0 after the write.
| |
| write | back to summary |
|---|---|
| public abstract void write(byte[] b, int off, int len) throws IOException Redeclares javax. Doc from javax. Writes a sequence of bytes to the stream at the current
position. If If the bit offset within the stream is non-zero, the
remainder of the current byte is padded with 0s
and written out first. The bit offset will be 0 after the
write. Implementers can use the
| |
| writeBit | back to summary |
|---|---|
| public void writeBit(int bit) throws IOException Implements javax. Doc from javax. Writes a single bit, given by the least significant bit of the argument, to the stream at the current bit offset within the current byte position. The upper 31 bits of the argument are ignored. The given bit replaces the previous bit at that position. The bit offset is advanced by one and reduced modulo 8. If any bits of a particular byte have never been set at the time the byte is flushed to the destination, those bits will be set to 0 automatically.
| |
| writeBits | back to summary |
|---|---|
| public void writeBits(long bits, int numBits) throws IOException Implements javax. Doc from javax. Writes a sequence of bits, given by the Bit data may be accumulated in memory indefinitely, until
If any bits of a particular byte have never been set at the time the byte is flushed to the destination, those bits will be set to 0 automatically.
| |
| writeBoolean | back to summary |
|---|---|
| public void writeBoolean(boolean v) throws IOException Implements javax. Doc from javax. Writes a If the bit offset within the stream is non-zero, the remainder of the current byte is padded with 0s and written out first. The bit offset will be 0 after the write.
| |
| writeByte | back to summary |
|---|---|
| public void writeByte(int v) throws IOException Implements javax. Doc from javax. Writes the 8 low-order bits of If the bit offset within the stream is non-zero, the remainder of the current byte is padded with 0s and written out first. The bit offset will be 0 after the write.
| |
| writeBytes | back to summary |
|---|---|
| public void writeBytes(String s) throws IOException Implements javax. Doc from javax. Writes a string to the output stream. For every character in
the string If If the bit offset within the stream is non-zero, the remainder of the current byte is padded with 0s and written out first. The bit offset will be 0 after the write.
| |
| writeChar | back to summary |
|---|---|
| public void writeChar(int v) throws IOException Implements javax. Doc from javax. This method is a synonym for
| |
| writeChars | back to summary |
|---|---|
| public void writeChars(String s) throws IOException Implements javax. Doc from javax. Writes a string to the output stream. For every character in
the string If If the bit offset within the stream is non-zero, the remainder of the current byte is padded with 0s and written out first. The bit offset will be 0 after the write.
| |
| writeChars | back to summary |
|---|---|
| public void writeChars(char[] c, int off, int len) throws IOException Implements javax. Doc from javax. Writes a sequence of chars to the stream at the current
position. If If the bit offset within the stream is non-zero, the remainder of the current byte is padded with 0s and written out first. The bit offset will be 0 after the write.
| |
| writeDouble | back to summary |
|---|---|
| public void writeDouble(double v) throws IOException Implements javax. Doc from javax. Writes a If the bit offset within the stream is non-zero, the remainder of the current byte is padded with 0s and written out first. The bit offset will be 0 after the write.
| |
| writeDoubles | back to summary |
|---|---|
| public void writeDoubles(double[] d, int off, int len) throws IOException Implements javax. Doc from javax. Writes a sequence of doubles to the stream at the current
position. If If the bit offset within the stream is non-zero, the remainder of the current byte is padded with 0s and written out first. The bit offset will be 0 after the write.
| |
| writeFloat | back to summary |
|---|---|
| public void writeFloat(float v) throws IOException Implements javax. Doc from javax. Writes a If the bit offset within the stream is non-zero, the remainder of the current byte is padded with 0s and written out first. The bit offset will be 0 after the write.
| |
| writeFloats | back to summary |
|---|---|
| public void writeFloats(float[] f, int off, int len) throws IOException Implements javax. Doc from javax. Writes a sequence of floats to the stream at the current
position. If If the bit offset within the stream is non-zero, the remainder of the current byte is padded with 0s and written out first. The bit offset will be 0 after the write.
| |
| writeInt | back to summary |
|---|---|
| public void writeInt(int v) throws IOException Implements javax. Doc from javax. Writes the 32 bits of (byte)((v >> 24) & 0xff) (byte)((v >> 16) & 0xff) (byte)((v >> 8) & 0xff) (byte)(v & 0xff)Otherwise, the bytes written will be: (byte)(v & 0xff) (byte)((v >> 8) & 0xff) (byte)((v >> 16) & 0xff) (byte)((v >> 24) & 0xff) If the bit offset within the stream is non-zero, the remainder of the current byte is padded with 0s and written out first. The bit offset will be 0 after the write.
| |
| writeInts | back to summary |
|---|---|
| public void writeInts(int[] i, int off, int len) throws IOException Implements javax. Doc from javax. Writes a sequence of ints to the stream at the current
position. If If the bit offset within the stream is non-zero, the remainder of the current byte is padded with 0s and written out first. The bit offset will be 0 after the write.
| |
| writeLong | back to summary |
|---|---|
| public void writeLong(long v) throws IOException Implements javax. Doc from javax. Writes the 64 bits of (byte)((v >> 56) & 0xff) (byte)((v >> 48) & 0xff) (byte)((v >> 40) & 0xff) (byte)((v >> 32) & 0xff) (byte)((v >> 24) & 0xff) (byte)((v >> 16) & 0xff) (byte)((v >> 8) & 0xff) (byte)(v & 0xff)Otherwise, the bytes written will be: (byte)(v & 0xff) (byte)((v >> 8) & 0xff) (byte)((v >> 16) & 0xff) (byte)((v >> 24) & 0xff) (byte)((v >> 32) & 0xff) (byte)((v >> 40) & 0xff) (byte)((v >> 48) & 0xff) (byte)((v >> 56) & 0xff) If the bit offset within the stream is non-zero, the remainder of the current byte is padded with 0s and written out first. The bit offset will be 0 after the write.
| |
| writeLongs | back to summary |
|---|---|
| public void writeLongs(long[] l, int off, int len) throws IOException Implements javax. Doc from javax. Writes a sequence of longs to the stream at the current
position. If If the bit offset within the stream is non-zero, the remainder of the current byte is padded with 0s and written out first. The bit offset will be 0 after the write.
| |
| writeShort | back to summary |
|---|---|
| public void writeShort(int v) throws IOException Implements javax. Doc from javax. Writes the 16 low-order bits of (byte)((v >> 8) & 0xff) (byte)(v & 0xff)Otherwise, the bytes written will be: (byte)(v & 0xff) (byte)((v >> 8) & 0xff) If the bit offset within the stream is non-zero, the remainder of the current byte is padded with 0s and written out first. The bit offset will be 0 after the write.
| |
| writeShorts | back to summary |
|---|---|
| public void writeShorts(short[] s, int off, int len) throws IOException Implements javax. Doc from javax. Writes a sequence of shorts to the stream at the current
position. If If the bit offset within the stream is non-zero, the remainder of the current byte is padded with 0s and written out first. The bit offset will be 0 after the write.
| |
| writeUTF | back to summary |
|---|---|
| public void writeUTF(String s) throws IOException Implements javax. Doc from javax. Writes two bytes of length information to the output stream in
network byte order, followed by the
modified UTF-8
representation of every character in the string If a character (byte)c If a character
If a character
First, the total number of bytes needed to represent all
the characters of The current byte order setting is ignored. If the bit offset within the stream is non-zero, the remainder of the current byte is padded with 0s and written out first. The bit offset will be 0 after the write. Note This method should not be used in the implementation of image formats that use standard UTF-8, because the modified UTF-8 used here is incompatible with standard UTF-8.
| |