Class ImageInputStreamImpl

java.lang.Object
javax.imageio.stream.ImageInputStreamImpl
All Implemented Interfaces:
Closeable, DataInput, AutoCloseable, ImageInputStream
Direct Known Subclasses:
FileCacheImageInputStream, FileImageInputStream, ImageOutputStreamImpl, MemoryCacheImageInputStream

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.

  • Field Summary

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

    Constructors
    Constructor
    Description
    Constructs an ImageInputStreamImpl.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected final void
    Throws an IOException if the stream has been closed.
    void
    Closes the stream.
    protected void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Finalization has been deprecated for removal.
    void
    Discards the initial position of the stream prior to the current stream position.
    void
    flushBefore(long pos)
    Discards the initial portion of the stream prior to the indicated position.
    int
    Returns the current bit offset, as an integer between 0 and 7, inclusive.
    Returns the byte order with which data values will be read from this stream as an instance of the java.nio.ByteOrder enumeration.
    long
    Returns the earliest position in the stream to which seeking may be performed.
    long
    Returns the current byte position of the stream.
    boolean
    Default implementation returns false.
    boolean
    Default implementation returns false.
    boolean
    Default implementation returns false.
    long
    Returns -1L to indicate that the stream has unknown length.
    void
    Pushes the current stream position onto a stack of marked positions.
    abstract int
    Reads a single byte from the stream and returns it as an int 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.
    int
    Reads a single bit from the stream and returns it as an int with the value 0 or 1.
    long
    readBits(int numBits)
    Reads a bitstring from the stream and returns it as a long, with the first bit read becoming the most significant bit of the output.
    boolean
    Reads a byte from the stream and returns a boolean value of true if it is nonzero, false if it is zero.
    byte
    Reads a byte from the stream and returns it as a byte value.
    void
    readBytes(IIOByteBuffer buf, int len)
    Reads up to len bytes from the stream, and modifies the supplied IIOByteBuffer to indicate the byte array, offset, and length where the data may be found.
    char
    Equivalent to readUnsignedShort, except that the result is returned using the char datatype.
    double
    Reads 8 bytes from the stream, and (conceptually) concatenates them according to the current byte order and returns the result as a double.
    float
    Reads 4 bytes from the stream, and (conceptually) concatenates them according to the current byte order and returns the result as a float.
    void