public final class BufferedFileImageInputStream
extends javax.imageio.stream.ImageInputStreamImpl
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.FileImageInputStream| Constructor and Description |
|---|
BufferedFileImageInputStream(java.io.File file)
Constructs a
BufferedFileImageInputStream that will read from a given File. |
BufferedFileImageInputStream(java.io.RandomAccessFile raf)
Constructs a
BufferedFileImageInputStream that will read from a given RandomAccessFile. |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
long |
length() |
int |
read() |
int |
read(byte[] bytes,
int offset,
int length) |
int |
readInt() |
long |
readLong() |
short |
readShort() |
void |
seek(long position) |
void |
setByteOrder(java.nio.ByteOrder byteOrder) |
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, skipBytespublic BufferedFileImageInputStream(java.io.File file)
throws java.io.FileNotFoundException
BufferedFileImageInputStream that will read from a given File.file - a File to read from.java.lang.IllegalArgumentException - if file is null.java.io.FileNotFoundException - if file is a directory or cannot be opened for reading
for any reason.public BufferedFileImageInputStream(java.io.RandomAccessFile raf)
BufferedFileImageInputStream that will read from a given RandomAccessFile.raf - a RandomAccessFile to read from.java.lang.IllegalArgumentException - if raf is null.public void setByteOrder(java.nio.ByteOrder byteOrder)
setByteOrder in interface javax.imageio.stream.ImageInputStreamsetByteOrder in class javax.imageio.stream.ImageInputStreamImplpublic int read()
throws java.io.IOException
read in interface javax.imageio.stream.ImageInputStreamread in class javax.imageio.stream.ImageInputStreamImpljava.io.IOExceptionpublic int read(byte[] bytes,
int offset,
int length)
throws java.io.IOException
read in interface javax.imageio.stream.ImageInputStreamread in class javax.imageio.stream.ImageInputStreamImpljava.io.IOExceptionpublic long length()
length in interface javax.imageio.stream.ImageInputStreamlength in class javax.imageio.stream.ImageInputStreamImplpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in interface javax.imageio.stream.ImageInputStreamclose in class javax.imageio.stream.ImageInputStreamImpljava.io.IOExceptionpublic short readShort()
throws java.io.IOException
readShort in interface java.io.DataInputreadShort in interface javax.imageio.stream.ImageInputStreamreadShort in class javax.imageio.stream.ImageInputStreamImpljava.io.IOExceptionpublic int readInt()
throws java.io.IOException
readInt in interface java.io.DataInputreadInt in interface javax.imageio.stream.ImageInputStreamreadInt in class javax.imageio.stream.ImageInputStreamImpljava.io.IOExceptionpublic long readLong()
throws java.io.IOException
readLong in interface java.io.DataInputreadLong in interface javax.imageio.stream.ImageInputStreamreadLong in class javax.imageio.stream.ImageInputStreamImpljava.io.IOExceptionpublic void seek(long position)
throws java.io.IOException
seek in interface javax.imageio.stream.ImageInputStreamseek in class javax.imageio.stream.ImageInputStreamImpljava.io.IOExceptionCopyright © 2021. All Rights Reserved.