ImageOutputStream (Java SE 15 & JDK 15) (original) (raw)

All Superinterfaces:

[AutoCloseable](../../../../java.base/java/lang/AutoCloseable.html "interface in java.lang"), [Closeable](../../../../java.base/java/io/Closeable.html "interface in java.io"), [DataInput](../../../../java.base/java/io/DataInput.html "interface in java.io"), [DataOutput](../../../../java.base/java/io/DataOutput.html "interface in java.io"), [ImageInputStream](ImageInputStream.html "interface in javax.imageio.stream")

All Known Implementing Classes:

[FileCacheImageOutputStream](FileCacheImageOutputStream.html "class in javax.imageio.stream"), [FileImageOutputStream](FileImageOutputStream.html "class in javax.imageio.stream"), [ImageOutputStreamImpl](ImageOutputStreamImpl.html "class in javax.imageio.stream"), [MemoryCacheImageOutputStream](MemoryCacheImageOutputStream.html "class in javax.imageio.stream")


public interface ImageOutputStream extends ImageInputStream, DataOutput

A seekable output stream interface for use byImageWriters. Various output destinations, such asOutputStreams and Files, 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.

See Also:

ImageInputStream

Modifier and Type Method Description
void flushBefore​(long pos) Flushes all data prior to the given position to the underlying destination, such as an OutputStream orFile.
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 modified UTF-8 representation of every character in the string s.

Methods declared in interface javax.imageio.stream.ImageInputStream

[close](ImageInputStream.html#close%28%29), [flush](ImageInputStream.html#flush%28%29), [getBitOffset](ImageInputStream.html#getBitOffset%28%29), [getByteOrder](ImageInputStream.html#getByteOrder%28%29), [getFlushedPosition](ImageInputStream.html#getFlushedPosition%28%29), [getStreamPosition](ImageInputStream.html#getStreamPosition%28%29), [isCached](ImageInputStream.html#isCached%28%29), [isCachedFile](ImageInputStream.html#isCachedFile%28%29), [isCachedMemory](ImageInputStream.html#isCachedMemory%28%29), [length](ImageInputStream.html#length%28%29), [mark](ImageInputStream.html#mark%28%29), [read](ImageInputStream.html#read%28%29), [read](ImageInputStream.html#read%28byte%5B%5D%29), [read](ImageInputStream.html#read%28byte%5B%5D,int,int%29), [readBit](ImageInputStream.html#readBit%28%29), [readBits](ImageInputStream.html#readBits%28int%29), [readBoolean](ImageInputStream.html#readBoolean%28%29), [readByte](ImageInputStream.html#readByte%28%29), [readBytes](ImageInputStream.html#readBytes%28javax.imageio.stream.IIOByteBuffer,int%29), [readChar](ImageInputStream.html#readChar%28%29), [readDouble](ImageInputStream.html#readDouble%28%29), [readFloat](ImageInputStream.html#readFloat%28%29), [readFully](ImageInputStream.html#readFully%28byte%5B%5D%29), [readFully](ImageInputStream.html#readFully%28byte%5B%5D,int,int%29), [readFully](ImageInputStream.html#readFully%28char%5B%5D,int,int%29), [readFully](ImageInputStream.html#readFully%28double%5B%5D,int,int%29), [readFully](ImageInputStream.html#readFully%28float%5B%5D,int,int%29), [readFully](ImageInputStream.html#readFully%28int%5B%5D,int,int%29), [readFully](ImageInputStream.html#readFully%28long%5B%5D,int,int%29), [readFully](ImageInputStream.html#readFully%28short%5B%5D,int,int%29), [readInt](ImageInputStream.html#readInt%28%29), [readLine](ImageInputStream.html#readLine%28%29), [readLong](ImageInputStream.html#readLong%28%29), [readShort](ImageInputStream.html#readShort%28%29), [readUnsignedByte](ImageInputStream.html#readUnsignedByte%28%29), [readUnsignedInt](ImageInputStream.html#readUnsignedInt%28%29), [readUnsignedShort](ImageInputStream.html#readUnsignedShort%28%29), [readUTF](ImageInputStream.html#readUTF%28%29), [reset](ImageInputStream.html#reset%28%29), [seek](ImageInputStream.html#seek%28long%29), [setBitOffset](ImageInputStream.html#setBitOffset%28int%29), [setByteOrder](ImageInputStream.html#setByteOrder%28java.nio.ByteOrder%29), [skipBytes](ImageInputStream.html#skipBytes%28int%29), [skipBytes](ImageInputStream.html#skipBytes%28long%29)