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 intDeprecated.private intDeprecated.(package private) static final intDeprecated.private final ByteBufferDeprecated.private final byte[]Deprecated.private RandomAccessFileDeprecated.Fields inherited from class ImageInputStreamImpl
bitOffset, byteOrder, flushedPos, streamPos -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Constructs aBufferedFileImageInputStreamthat will read from a givenFile.Deprecated.Constructs aBufferedFileImageInputStreamthat will read from a givenRandomAccessFile. -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanDeprecated.voidclose()Deprecated.private booleanDeprecated.longlength()Deprecated.intread()Deprecated.intread(byte[] bytes, int offset, int length) Deprecated.private intreadBuffered(byte[] bytes, int offset, int length) Deprecated.private intreadDirect(byte[] bytes, int offset, int length) Deprecated.intreadInt()Deprecated.longreadLong()Deprecated.shortDeprecated.voidseek(long position) Deprecated.voidsetByteOrder(ByteOrder byteOrder) Deprecated.Methods inherited from class 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 aBufferedFileImageInputStreamthat will read from a givenFile.- Parameters:
file- aFileto read from.- Throws:
IllegalArgumentException- iffileisnull.FileNotFoundException- iffileis a directory or cannot be opened for reading for any reason.
-
BufferedFileImageInputStream
Deprecated.Constructs aBufferedFileImageInputStreamthat will read from a givenRandomAccessFile.- Parameters:
raf- aRandomAccessFileto read from.- Throws:
IllegalArgumentException- ifrafisnull.
-
-
Method Details
-
fillBuffer
-
bufferEmpty
private boolean bufferEmpty()Deprecated. -
setByteOrder
Deprecated.- Specified by:
setByteOrderin interfaceImageInputStream- Overrides:
setByteOrderin classImageInputStreamImpl
-
read
Deprecated.- Specified by:
readin interfaceImageInputStream- Specified by:
readin classImageInputStreamImpl- Throws:
IOException
-
read
Deprecated.- Specified by:
readin interfaceImageInputStream- Specified by:
readin 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:
lengthin interfaceImageInputStream- Overrides:
lengthin classImageInputStreamImpl
-
close
Deprecated.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceImageInputStream- Overrides:
closein classImageInputStreamImpl- Throws:
IOException
-
readShort
Deprecated.- Specified by:
readShortin interfaceDataInput- Specified by:
readShortin interfaceImageInputStream- Overrides:
readShortin classImageInputStreamImpl- Throws:
IOException
-
readInt
Deprecated.- Specified by:
readIntin interfaceDataInput- Specified by:
readIntin interfaceImageInputStream- Overrides:
readIntin classImageInputStreamImpl- Throws:
IOException
-
readLong
Deprecated.- Specified by:
readLongin interfaceDataInput- Specified by:
readLongin interfaceImageInputStream- Overrides:
readLongin classImageInputStreamImpl- Throws:
IOException
-
seek
Deprecated.- Specified by:
seekin interfaceImageInputStream- Overrides:
seekin classImageInputStreamImpl- Throws:
IOException
-
BufferedChannelImageInputStreaminstead.