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

All Implemented Interfaces:

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

Direct Known Subclasses:

[FileCacheImageInputStream](FileCacheImageInputStream.html "class in javax.imageio.stream"), [FileImageInputStream](FileImageInputStream.html "class in javax.imageio.stream"), [ImageOutputStreamImpl](ImageOutputStreamImpl.html "class in javax.imageio.stream"), [MemoryCacheImageInputStream](MemoryCacheImageInputStream.html "class in javax.imageio.stream")


public abstract class ImageInputStreamImpl extends Object implements ImageInputStream

An abstract class implementing the ImageInputStream interface. This class is designed to reduce the number of methods that must be implemented by subclasses.

In particular, this class handles most or all of the details of byte order interpretation, buffering, mark/reset, discarding, closing, and disposing.

Fields

Modifier and Type Field Description
protected int bitOffset The current bit offset within the stream.
protected ByteOrder byteOrder The byte order of the stream as an instance of the enumeration class java.nio.ByteOrder, whereByteOrder.BIG_ENDIAN indicates network byte order and ByteOrder.LITTLE_ENDIAN indicates the reverse order.
protected long flushedPos The position prior to which data may be discarded.
protected long streamPos The current read position within the stream.

Constructors

Constructor Description
ImageInputStreamImpl() Constructs an ImageInputStreamImpl.
Modifier and Type Method Description
protected void checkClosed() Throws an IOException if the stream has been closed.
protected void finalize() Deprecated.
boolean isCached() Default implementation returns false.
boolean isCachedFile() Default implementation returns false.
boolean isCachedMemory() Default implementation returns false.
long length() Returns -1L to indicate that the stream has unknown length.
void mark() Pushes the current stream position onto a stack of marked positions.
abstract int read() Reads a single byte from the stream and returns it as anint between 0 and 255.
int read​(byte[] b) A convenience method that calls read(b, 0, b.length).
abstract int read​(byte[] b, int off, int len) Reads up to len bytes from the stream, and stores them into b starting at index off.
void reset() Resets the current stream byte and bit positions from the stack of marked positions.
int skipBytes​(int n) Advances the current stream position by callingseek(getStreamPosition() + n).
long skipBytes​(long n) Advances the current stream position by callingseek(getStreamPosition() + n).

Methods declared in interface javax.imageio.stream.ImageInputStream

[close](ImageInputStream.html#close%28%29), [flush](ImageInputStream.html#flush%28%29), [flushBefore](ImageInputStream.html#flushBefore%28long%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), [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), [seek](ImageInputStream.html#seek%28long%29), [setBitOffset](ImageInputStream.html#setBitOffset%28int%29), [setByteOrder](ImageInputStream.html#setByteOrder%28java.nio.ByteOrder%29)