Package com.twelvemonkeys.imageio.stream
Class BufferedFileImageInputStream
java.lang.Object
javax.imageio.stream.ImageInputStreamImpl
com.twelvemonkeys.imageio.stream.BufferedFileImageInputStream
- All Implemented Interfaces:
Closeable
,DataInput
,AutoCloseable
,ImageInputStream
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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate byte[]
Deprecated.private int
Deprecated.private int
Deprecated.(package private) static final int
Deprecated.private final ByteBuffer
Deprecated.private final byte[]
Deprecated.private RandomAccessFile
Deprecated.Fields inherited from class javax.imageio.stream.ImageInputStreamImpl
bitOffset, byteOrder, flushedPos, streamPos
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Constructs aBufferedFileImageInputStream
that will read from a givenFile
.Deprecated.Constructs aBufferedFileImageInputStream
that will read from a givenRandomAccessFile
. -
Method Summary
Modifier and TypeMethodDescriptionprivate boolean
Deprecated.void
close()
Deprecated.private boolean
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
Deprecated.void
seek
(long position) Deprecated.void
setByteOrder
(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 Details
-
DEFAULT_BUFFER_SIZE
static final int DEFAULT_BUFFER_SIZEDeprecated.- See Also:
-
buffer
private byte[] bufferDeprecated. -
bufferPos
private int bufferPosDeprecated. -
bufferLimit
private int bufferLimitDeprecated. -
integralCache
Deprecated. -
integralCacheArray
private final byte[] integralCacheArrayDeprecated. -
raf
Deprecated.
-
-
Constructor Details
-
BufferedFileImageInputStream
Deprecated.Constructs aBufferedFileImageInputStream
that will read from a givenFile
.- Parameters:
file
- aFile
to read from.- Throws:
IllegalArgumentException
- iffile
isnull
.FileNotFoundException
- iffile
is a directory or cannot be opened for reading for any reason.
-
BufferedFileImageInputStream
Deprecated.Constructs aBufferedFileImageInputStream
that will read from a givenRandomAccessFile
.- Parameters:
raf
- aRandomAccessFile
to read from.- Throws:
IllegalArgumentException
- ifraf
isnull
.
-
-
Method Details
-
fillBuffer
Deprecated.- Throws:
IOException
-
bufferEmpty
private boolean bufferEmpty()Deprecated. -
setByteOrder
Deprecated.- Specified by:
setByteOrder
in interfaceImageInputStream
- Overrides:
setByteOrder
in classImageInputStreamImpl
-
read
Deprecated.- Specified by:
read
in interfaceImageInputStream
- Specified by:
read
in classImageInputStreamImpl
- Throws:
IOException
-
read
Deprecated.- Specified by:
read
in interfaceImageInputStream
- Specified by:
read
in classImageInputStreamImpl
- Throws:
IOException
-
readDirect
Deprecated.- Throws:
IOException
-
readBuffered
private int readBuffered(byte[] bytes, int offset, int length) Deprecated. -
length
public long length()Deprecated.- Specified by:
length
in interfaceImageInputStream
- Overrides:
length
in classImageInputStreamImpl
-
close
Deprecated.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceImageInputStream
- Overrides:
close
in classImageInputStreamImpl
- Throws:
IOException
-
readShort
Deprecated.- Specified by:
readShort
in interfaceDataInput
- Specified by:
readShort
in interfaceImageInputStream
- Overrides:
readShort
in classImageInputStreamImpl
- Throws:
IOException
-
readInt
Deprecated.- Specified by:
readInt
in interfaceDataInput
- Specified by:
readInt
in interfaceImageInputStream
- Overrides:
readInt
in classImageInputStreamImpl
- Throws:
IOException
-
readLong
Deprecated.- Specified by:
readLong
in interfaceDataInput
- Specified by:
readLong
in interfaceImageInputStream
- Overrides:
readLong
in classImageInputStreamImpl
- Throws:
IOException
-
seek
Deprecated.- Specified by:
seek
in interfaceImageInputStream
- Overrides:
seek
in classImageInputStreamImpl
- Throws:
IOException
-
BufferedChannelImageInputStream
instead.