Package com.twelvemonkeys.imageio.stream
Class BufferedFileImageInputStream
- java.lang.Object
-
- javax.imageio.stream.ImageInputStreamImpl
-
- com.twelvemonkeys.imageio.stream.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.UseBufferedChannelImageInputStream
instead.A buffered replacement forFileImageInputStream
that provides greatly improved performance for shorter reads, like single byte or bit reads. As withjavax.imageio.stream.FileImageInputStream
, eitherFile
orRandomAccessFile
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.
-
Constructor Summary
Constructors Constructor Description BufferedFileImageInputStream(java.io.File file)
Deprecated.Constructs aBufferedFileImageInputStream
that will read from a givenFile
.BufferedFileImageInputStream(java.io.RandomAccessFile raf)
Deprecated.Constructs aBufferedFileImageInputStream
that will read from a givenRandomAccessFile
.
-
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
-
-
-
-
Field Detail
-
DEFAULT_BUFFER_SIZE
static final int DEFAULT_BUFFER_SIZE
Deprecated.- See Also:
- Constant Field Values
-
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 aBufferedFileImageInputStream
that will read from a givenFile
.- Parameters:
file
- aFile
to read from.- Throws:
java.lang.IllegalArgumentException
- iffile
isnull
.java.io.FileNotFoundException
- iffile
is a directory or cannot be opened for reading for any reason.
-
BufferedFileImageInputStream
public BufferedFileImageInputStream(java.io.RandomAccessFile raf)
Deprecated.Constructs aBufferedFileImageInputStream
that will read from a givenRandomAccessFile
.- Parameters:
raf
- aRandomAccessFile
to read from.- Throws:
java.lang.IllegalArgumentException
- ifraf
isnull
.
-
-
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 interfacejavax.imageio.stream.ImageInputStream
- Overrides:
setByteOrder
in classjavax.imageio.stream.ImageInputStreamImpl
-
read
public int read() throws java.io.IOException
Deprecated.- Specified by:
read
in interfacejavax.imageio.stream.ImageInputStream
- Specified by:
read
in classjavax.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 interfacejavax.imageio.stream.ImageInputStream
- Specified by:
read
in classjavax.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 interfacejavax.imageio.stream.ImageInputStream
- Overrides:
length
in classjavax.imageio.stream.ImageInputStreamImpl
-
close
public void close() throws java.io.IOException
Deprecated.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Specified by:
close
in interfacejavax.imageio.stream.ImageInputStream
- Overrides:
close
in classjavax.imageio.stream.ImageInputStreamImpl
- Throws:
java.io.IOException
-
readShort
public short readShort() throws java.io.IOException
Deprecated.- Specified by:
readShort
in interfacejava.io.DataInput
- Specified by:
readShort
in interfacejavax.imageio.stream.ImageInputStream
- Overrides:
readShort
in classjavax.imageio.stream.ImageInputStreamImpl
- Throws:
java.io.IOException
-
readInt
public int readInt() throws java.io.IOException
Deprecated.- Specified by:
readInt
in interfacejava.io.DataInput
- Specified by:
readInt
in interfacejavax.imageio.stream.ImageInputStream
- Overrides:
readInt
in classjavax.imageio.stream.ImageInputStreamImpl
- Throws:
java.io.IOException
-
readLong
public long readLong() throws java.io.IOException
Deprecated.- Specified by:
readLong
in interfacejava.io.DataInput
- Specified by:
readLong
in interfacejavax.imageio.stream.ImageInputStream
- Overrides:
readLong
in classjavax.imageio.stream.ImageInputStreamImpl
- Throws:
java.io.IOException
-
seek
public void seek(long position) throws java.io.IOException
Deprecated.- Specified by:
seek
in interfacejavax.imageio.stream.ImageInputStream
- Overrides:
seek
in classjavax.imageio.stream.ImageInputStreamImpl
- Throws:
java.io.IOException
-
-