public class FileImageInputStreamExtImpl extends ImageInputStreamImpl implements FileImageInputStreamExt
ImageInputStream that gets its input from a
File. The eraf contents are assumed to be stable during the lifetime
of the object.bitOffset, byteOrder, flushedPos, streamPos| Constructor and Description |
|---|
FileImageInputStreamExtImpl(File f)
Constructs a
FileImageInputStreamExtImpl that will read from a
given File. |
FileImageInputStreamExtImpl(File f,
int bufferSize)
Constructs a
FileImageInputStreamExtImpl that will read from a
given File. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the underlying
EnhancedRandomAccessFile. |
void |
dispose()
Disposes this
FileImageInputStreamExtImpl by closing its
underlying EnhancedRandomAccessFile. |
Class<File> |
getBinding()
Retrieve the class for the target object.
|
ByteOrder |
getByteOrder() |
File |
getFile()
Retrieves the
File we are connected to. |
long |
getStreamPosition() |
File |
getTarget()
Retrieves the target object on which we work.
|
boolean |
isCached() |
long |
length()
Returns the length of the underlying eraf, or
-1 if it is
unknown. |
int |
read()
Reads an int from the underlying
EnhancedRandomAccessFile. |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len)
Read up to
len bytes into an array, at a specified offset. |
byte |
readByte() |
char |
readChar() |
double |
readDouble() |
float |
readFloat() |
void |
readFully(byte[] b) |
void |
readFully(byte[] b,
int off,
int len) |
int |
readInt() |
String |
readLine() |
long |
readLong() |
short |
readShort() |
int |
readUnsignedByte() |
long |
readUnsignedInt() |
int |
readUnsignedShort() |
String |
readUTF() |
void |
seek(long pos)
Seeks the current position to pos.
|
void |
setByteOrder(ByteOrder byteOrder) |
int |
skipBytes(int n) |
long |
skipBytes(long n) |
String |
toString()
Provides a simple description for this
ImageInputStream. |
checkClosed, finalize, flush, flushBefore, getBitOffset, getFlushedPosition, isCachedFile, isCachedMemory, mark, readBit, readBits, readBoolean, readBytes, readFully, readFully, readFully, readFully, readFully, readFully, reset, setBitOffsetclone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitflush, flushBefore, getBitOffset, getFlushedPosition, isCachedFile, isCachedMemory, mark, readBit, readBits, readBoolean, readBytes, readFully, readFully, readFully, readFully, readFully, readFully, reset, setBitOffsetpublic FileImageInputStreamExtImpl(File f) throws FileNotFoundException, IOException
FileImageInputStreamExtImpl that will read from a
given File.
The eraf contents must not change between the time this object is constructed and the time of the last call to a read method.
f - a File to read from.NullPointerException - if f is null.SecurityException - if a security manager exists and does not allow read
access to the eraf.FileNotFoundException - if f is a directory or cannot be opened
for reading for any other reason.IOException - if an I/O error occurs.public FileImageInputStreamExtImpl(File f, int bufferSize) throws IOException
FileImageInputStreamExtImpl that will read from a
given File.
The eraf contents must not change between the time this object is constructed and the time of the last call to a read method.
f - a File to read from.bufferSize - size of the underlying buffer.NullPointerException - if f is null.SecurityException - if a security manager exists and does not allow read
access to the eraf.FileNotFoundException - if f is a directory or cannot be opened
for reading for any other reason.IOException - if an I/O error occurs.public byte readByte()
throws IOException
readByte in interface DataInputreadByte in interface ImageInputStreamreadByte in class ImageInputStreamImplIOExceptionpublic char readChar()
throws IOException
readChar in interface DataInputreadChar in interface ImageInputStreamreadChar in class ImageInputStreamImplIOExceptionpublic double readDouble()
throws IOException
readDouble in interface DataInputreadDouble in interface ImageInputStreamreadDouble in class ImageInputStreamImplIOExceptionpublic float readFloat()
throws IOException
readFloat in interface DataInputreadFloat in interface ImageInputStreamreadFloat in class ImageInputStreamImplIOExceptionpublic void readFully(byte[] b,
int off,
int len)
throws IOException
readFully in interface DataInputreadFully in interface ImageInputStreamreadFully in class ImageInputStreamImplIOExceptionpublic void readFully(byte[] b)
throws IOException
readFully in interface DataInputreadFully in interface ImageInputStreamreadFully in class ImageInputStreamImplIOExceptionpublic int readInt()
throws IOException
readInt in interface DataInputreadInt in interface ImageInputStreamreadInt in class ImageInputStreamImplIOExceptionpublic String readLine() throws IOException
readLine in interface DataInputreadLine in interface ImageInputStreamreadLine in class ImageInputStreamImplIOExceptionpublic ByteOrder getByteOrder()
getByteOrder in interface ImageInputStreamgetByteOrder in class ImageInputStreamImplpublic long getStreamPosition()
throws IOException
getStreamPosition in interface ImageInputStreamgetStreamPosition in class ImageInputStreamImplIOExceptionpublic boolean isCached()
isCached in interface ImageInputStreamisCached in class ImageInputStreamImplpublic int read(byte[] b)
throws IOException
read in interface ImageInputStreamread in class ImageInputStreamImplIOExceptionpublic long skipBytes(long n)
throws IOException
skipBytes in interface ImageInputStreamskipBytes in class ImageInputStreamImplIOExceptionpublic long readLong()
throws IOException
readLong in interface DataInputreadLong in interface ImageInputStreamreadLong in class ImageInputStreamImplIOExceptionpublic short readShort()
throws IOException
readShort in interface DataInputreadShort in interface ImageInputStreamreadShort in class ImageInputStreamImplIOExceptionpublic int readUnsignedByte()
throws IOException
readUnsignedByte in interface DataInputreadUnsignedByte in interface ImageInputStreamreadUnsignedByte in class ImageInputStreamImplIOExceptionpublic long readUnsignedInt()
throws IOException
readUnsignedInt in interface ImageInputStreamreadUnsignedInt in class ImageInputStreamImplIOExceptionpublic int readUnsignedShort()
throws IOException
readUnsignedShort in interface DataInputreadUnsignedShort in interface ImageInputStreamreadUnsignedShort in class ImageInputStreamImplIOExceptionpublic String readUTF() throws IOException
readUTF in interface DataInputreadUTF in interface ImageInputStreamreadUTF in class ImageInputStreamImplIOExceptionpublic void setByteOrder(ByteOrder byteOrder)
setByteOrder in interface ImageInputStreamsetByteOrder in class ImageInputStreamImplpublic int skipBytes(int n)
throws IOException
skipBytes in interface DataInputskipBytes in interface ImageInputStreamskipBytes in class ImageInputStreamImplIOExceptionpublic int read()
throws IOException
EnhancedRandomAccessFile.read in interface ImageInputStreamread in class ImageInputStreamImplIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
len bytes into an array, at a specified offset.
This will block until at least one byte has been read.read in interface ImageInputStreamread in class ImageInputStreamImplb - the byte array to receive the bytes.off - the offset in the array where copying will start.len - the number of bytes to copy.IOExceptionpublic long length()
-1 if it is
unknown.length in interface ImageInputStreamlength in class ImageInputStreamImpllong, or -1.public void seek(long pos)
throws IOException
seek in interface ImageInputStreamseek in class ImageInputStreamImplIOExceptionpublic void close()
throws IOException
EnhancedRandomAccessFile.close in interface Closeableclose in interface AutoCloseableclose in interface ImageInputStreamclose in class ImageInputStreamImplIOException - in case something bad happens.public File getFile()
File we are connected to.getFile in interface FileImageInputStreamExtFilepublic void dispose()
FileImageInputStreamExtImpl by closing its
underlying EnhancedRandomAccessFile.public String toString()
ImageInputStream.toString in class ObjectImageInputStream.public File getTarget()
AccessibleStreamgetTarget in interface AccessibleStream<File>public Class<File> getBinding()
AccessibleStreamgetBinding in interface AccessibleStream<File>Copyright © 2006–2019 GeoSolutions. All rights reserved.