Class BufferedFileImageInputStream

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

    @Deprecated
    public final class BufferedFileImageInputStream
    extends javax.imageio.stream.ImageInputStreamImpl
    Deprecated.
    A buffered replacement for FileImageInputStream that provides greatly improved performance for shorter reads, like single byte or bit reads. As with javax.imageio.stream.FileImageInputStream, either File or RandomAccessFile can be used as input.
    See Also:
    FileImageInputStream
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private byte[] buffer
      Deprecated.
       
      private int bufferLimit
      Deprecated.
       
      private int bufferPos
      Deprecated.
       
      (package private) static int DEFAULT_BUFFER_SIZE
      Deprecated.
       
      private java.nio.ByteBuffer integralCache
      Deprecated.
       
      private byte[] integralCacheArray
      Deprecated.
       
      private java.io.RandomAccessFile raf
      Deprecated.
       
      • Fields inherited from class javax.imageio.stream.ImageInputStreamImpl

        bitOffset, byteOrder, flushedPos, streamPos
    • Constructor Summary

      Constructors 
      Constructor Description
      BufferedFileImageInputStream​(java.io.File file)
      Deprecated.
      Constructs a BufferedFileImageInputStream that will read from a given File.
      BufferedFileImageInputStream​(java.io.RandomAccessFile raf)
      Deprecated.
      Constructs a BufferedFileImageInputStream that will read from a given RandomAccessFile.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      private boolean bufferEmpty()
      Deprecated.
       
      void close()
      Deprecated.
       
      private boolean fillBuffer()
      Deprecated.
       
      long length()
      Deprecated.
       
      int read()
      Deprecated.
       
      int read​(byte[] bytes, int offset, int length)
      Deprecated.
       
      private int readBuffered​(byte[] bytes, int offset, int length)
      Deprecated.
       
      private int readDirect​(byte[] bytes, int offset, int length)
      Deprecated.
       
      int readInt()
      Deprecated.
       
      long readLong()
      Deprecated.
       
      short readShort()
      Deprecated.
       
      void seek​(long position)
      Deprecated.
       
      void setByteOrder​(java.nio.ByteOrder byteOrder)
      Deprecated.
       
      • Methods inherited from class javax.imageio.stream.ImageInputStreamImpl

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

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

      • buffer

        private byte[] buffer
        Deprecated.
      • bufferPos

        private int bufferPos
        Deprecated.
      • bufferLimit

        private int bufferLimit
        Deprecated.
      • integralCache

        private final java.nio.ByteBuffer integralCache
        Deprecated.
      • integralCacheArray

        private final byte[] integralCacheArray
        Deprecated.
      • raf

        private java.io.RandomAccessFile raf
        Deprecated.
    • Constructor Detail

      • BufferedFileImageInputStream

        public BufferedFileImageInputStream​(java.io.File file)
                                     throws java.io.FileNotFoundException
        Deprecated.
        Constructs a BufferedFileImageInputStream that will read from a given File.
        Parameters:
        file - a File to read from.
        Throws:
        java.lang.IllegalArgumentException - if file is null.
        java.io.FileNotFoundException - if file is a directory or cannot be opened for reading for any reason.
      • BufferedFileImageInputStream

        public BufferedFileImageInputStream​(java.io.RandomAccessFile raf)
        Deprecated.
        Constructs a BufferedFileImageInputStream that will read from a given RandomAccessFile.
        Parameters:
        raf - a RandomAccessFile to read from.
        Throws:
        java.lang.IllegalArgumentException - if raf is null.
    • Method Detail

      • fillBuffer

        private boolean fillBuffer()
                            throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException
      • bufferEmpty

        private boolean bufferEmpty()
        Deprecated.
      • setByteOrder

        public void setByteOrder​(java.nio.ByteOrder byteOrder)
        Deprecated.
        Specified by:
        setByteOrder in interface javax.imageio.stream.ImageInputStream
        Overrides:
        setByteOrder in class javax.imageio.stream.ImageInputStreamImpl
      • read

        public int read()
                 throws java.io.IOException
        Deprecated.
        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 offset,
                        int length)
                 throws java.io.IOException
        Deprecated.
        Specified by:
        read in interface javax.imageio.stream.ImageInputStream
        Specified by:
        read in class javax.imageio.stream.ImageInputStreamImpl
        Throws:
        java.io.IOException
      • readDirect

        private int readDirect​(byte[] bytes,
                               int offset,
                               int length)
                        throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException
      • readBuffered

        private int readBuffered​(byte[] bytes,
                                 int offset,
                                 int length)
        Deprecated.
      • length

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

        public void close()
                   throws java.io.IOException
        Deprecated.
        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
      • readShort

        public short readShort()
                        throws java.io.IOException
        Deprecated.
        Specified by:
        readShort in interface java.io.DataInput
        Specified by:
        readShort in interface javax.imageio.stream.ImageInputStream
        Overrides:
        readShort in class javax.imageio.stream.ImageInputStreamImpl
        Throws:
        java.io.IOException
      • readInt

        public int readInt()
                    throws java.io.IOException
        Deprecated.
        Specified by:
        readInt in interface java.io.DataInput
        Specified by:
        readInt in interface javax.imageio.stream.ImageInputStream
        Overrides:
        readInt in class javax.imageio.stream.ImageInputStreamImpl
        Throws:
        java.io.IOException
      • readLong

        public long readLong()
                      throws java.io.IOException
        Deprecated.
        Specified by:
        readLong in interface java.io.DataInput
        Specified by:
        readLong in interface javax.imageio.stream.ImageInputStream
        Overrides:
        readLong in class javax.imageio.stream.ImageInputStreamImpl
        Throws:
        java.io.IOException
      • seek

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