Class DirectImageInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.io.DataInput, java.lang.AutoCloseable, javax.imageio.stream.ImageInputStream

    public final class DirectImageInputStream
    extends javax.imageio.stream.ImageInputStreamImpl
    An ImageInputStream that adapts an InputSteam, by reading directly from the stream without and form of caching or buffering.

    Note: This is not a general-purpose ImageInputStream, and is designed for reading large chunks, typically of pixel data, from an InputStream. It does not support backwards seeking, or reading bits.

    • Field Summary

      • Fields inherited from class javax.imageio.stream.ImageInputStreamImpl

        bitOffset, byteOrder, flushedPos, streamPos
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      long getFlushedPosition()  
      long length()  
      int read()  
      int read​(byte[] bytes, int off, int len)  
      int readBit()  
      long readBits​(int numBits)  
      void seek​(long pos)  
      • Methods inherited from class javax.imageio.stream.ImageInputStreamImpl

        checkClosed, finalize, flush, flushBefore, getBitOffset, getByteOrder, getStreamPosition, isCached, isCachedFile, isCachedMemory, mark, read, readBoolean, readByte, readBytes, readChar, readDouble, readFloat, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedInt, readUnsignedShort, readUTF, reset, setBitOffset, setByteOrder, skipBytes, skipBytes
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DirectImageInputStream

        public DirectImageInputStream​(java.io.InputStream stream)
      • DirectImageInputStream

        public DirectImageInputStream​(java.io.InputStream stream,
                                      long length)
    • Method Detail

      • read

        public int read()
                 throws java.io.IOException
        Specified by:
        read in interface javax.imageio.stream.ImageInputStream
        Specified by:
        read in class javax.imageio.stream.ImageInputStreamImpl
        Throws:
        java.io.IOException
      • read

        public int read​(byte[] bytes,
                        int off,
                        int len)
                 throws java.io.IOException
        Specified by:
        read in interface javax.imageio.stream.ImageInputStream
        Specified by:
        read in class javax.imageio.stream.ImageInputStreamImpl
        Throws:
        java.io.IOException
      • seek

        public void seek​(long pos)
                  throws java.io.IOException
        Specified by:
        seek in interface javax.imageio.stream.ImageInputStream
        Overrides:
        seek in class javax.imageio.stream.ImageInputStreamImpl
        Throws:
        java.io.IOException
      • getFlushedPosition

        public long getFlushedPosition()
        Specified by:
        getFlushedPosition in interface javax.imageio.stream.ImageInputStream
        Overrides:
        getFlushedPosition in class javax.imageio.stream.ImageInputStreamImpl
      • length

        public long length()
        Specified by:
        length in interface javax.imageio.stream.ImageInputStream
        Overrides:
        length in class javax.imageio.stream.ImageInputStreamImpl
      • readBit

        public int readBit()
                    throws java.io.IOException
        Specified by:
        readBit in interface javax.imageio.stream.ImageInputStream
        Overrides:
        readBit in class javax.imageio.stream.ImageInputStreamImpl
        Throws:
        java.io.IOException
      • readBits

        public long readBits​(int numBits)
                      throws java.io.IOException
        Specified by:
        readBits in interface javax.imageio.stream.ImageInputStream
        Overrides:
        readBits in class javax.imageio.stream.ImageInputStreamImpl
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface javax.imageio.stream.ImageInputStream
        Overrides:
        close in class javax.imageio.stream.ImageInputStreamImpl
        Throws:
        java.io.IOException