public interface ImageOutputStream extends ImageInputStream, DataOutput
ImageWriter
s. Various output destinations, such as
OutputStream
s and File
s, as well as
future fast I/O destinations may be "wrapped" by a suitable
implementation of this interface for use by the Image I/O API.
Unlike a standard OutputStream
, ImageOutputStream
extends its counterpart, ImageInputStream
. Thus it is
possible to read from the stream as it is being written. The same
seek and flush positions apply to both reading and writing, although
the semantics for dealing with a non-zero bit offset before a byte-aligned
write are necessarily different from the semantics for dealing with
a non-zero bit offset before a byte-aligned read. When reading bytes,
any bit offset is set to 0 before the read; when writing bytes, a
non-zero bit offset causes the remaining bits in the byte to be written
as 0s. The byte-aligned write then starts at the next byte position.
ImageInputStream
Modifier and Type | Method and Description |
---|---|
void |
flushBefore(long pos)
Flushes all data prior to the given position to the underlying
destination, such as an
OutputStream or
File . |
void |
write(byte[] b)
Writes a sequence of bytes to the stream at the current
position.
|
void |
write(byte[] b,
int off,
int len)
Writes a sequence of bytes to the stream at the current
position.
|
void |
write(int b)
Writes a single byte to the stream at the current position.
|
void |
writeBit(int bit)
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.
|
void |
writeBits(long bits,
int numBits)
Writes a sequence of bits, given by the
numBits
least significant bits of the bits argument in
left-to-right order, to the stream at the current bit offset
within the current byte position. |
void |
writeBoolean(boolean v)
Writes a
boolean value to the stream. |
void |
writeByte(int v)
Writes the 8 low-order bits of
v to the
stream. |
void |
writeBytes(String s)
Writes a string to the output stream.
|
void |
writeChar(int v)
This method is a synonym for
writeShort . |
void |
writeChars(char[] c,
int off,
int len)
Writes a sequence of chars to the stream at the current
position.
|
void |
writeChars(String s)
Writes a string to the output stream.
|
void |
writeDouble(double v)
Writes a
double value, which is comprised of four
bytes, to the output stream. |
void |
writeDoubles(double[] d,
int off,
int len)
Writes a sequence of doubles to the stream at the current
position.
|
void |
writeFloat(float v)
Writes a
float value, which is comprised of four
bytes, to the output stream. |
void |
writeFloats(float[] f,
int off,
int len)
Writes a sequence of floats to the stream at the current
position.
|
void |
writeInt(int v)
Writes the 32 bits of
v to the stream. |
void |
writeInts(int[] i,
int off,
int len)
Writes a sequence of ints to the stream at the current
position.
|
void |
writeLong(long v)
Writes the 64 bits of
v to the stream. |
void |
writeLongs(long[] l,
int off,
int len)
Writes a sequence of longs to the stream at the current
position.
|
void |
writeShort(int v)
Writes the 16 low-order bits of
v to the
stream. |
void |
writeShorts(short[] s,
int off,
int len)
Writes a sequence of shorts to the stream at the current
position.
|
void |
writeUTF(String s)
Writes two bytes of length information to the output stream in
network byte order, followed by the
Methods inherited from interface javax.imageio.stream.ImageInputStreamclose, flush, getBitOffset, getByteOrder, getFlushedPosition, getStreamPosition, isCached, isCachedFile, isCachedMemory, length, mark, read, read, read, readBit, readBits, readBoolean, readByte, readBytes, readChar, readDouble, readFloat, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedInt, readUnsignedShort, readUTF, reset, seek, setBitOffset, setByteOrder, skipBytes, skipBytes
Submit a bug or feature |