|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectImageInputStreamImpl
FileImageInputStreamExtFileChannelImpl
public class FileImageInputStreamExtFileChannelImpl
An implementation of ImageInputStream that gets its input from a
File dealing with FileChannels.
| Field Summary |
|---|
| Fields inherited from class ImageInputStreamImpl |
|---|
bitOffset, byteOrder, flushedPos, streamPos |
| Constructor Summary | |
|---|---|
FileImageInputStreamExtFileChannelImpl(File f)
Constructs a FileImageInputStreamExtFileChannelImpl that will read from a
given File. |
|
FileImageInputStreamExtFileChannelImpl(File f,
int bufferSize)
Constructs a FileImageInputStreamExtFileChannelImpl that will read from a
given File. |
|
| Method Summary | |
|---|---|
void |
close()
Closes the underlying EnhancedRandomAccessFile. |
void |
dispose()
Disposes this FileImageInputStreamExtFileChannelImpl 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. |
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. |
| Methods inherited from class ImageInputStreamImpl |
|---|
checkClosed, finalize, flush, flushBefore, getBitOffset, getFlushedPosition, isCached, isCachedFile, isCachedMemory, mark, readBit, readBits, readBoolean, readBytes, readFully, readFully, readFully, readFully, readFully, readFully, reset, setBitOffset |
| Methods inherited from class Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface ImageInputStream |
|---|
flush, flushBefore, getBitOffset, getFlushedPosition, isCached, isCachedFile, isCachedMemory, mark, readBit, readBits, readBoolean, readBytes, readFully, readFully, readFully, readFully, readFully, readFully, reset, setBitOffset |
| Constructor Detail |
|---|
public FileImageInputStreamExtFileChannelImpl(File f)
throws FileNotFoundException,
IOException
FileImageInputStreamExtFileChannelImpl 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 FileImageInputStreamExtFileChannelImpl(File f,
int bufferSize)
throws IOException
FileImageInputStreamExtFileChannelImpl 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.| Method Detail |
|---|
public byte readByte()
throws IOException
readByte in interface DataInputreadByte in interface ImageInputStreamreadByte in class ImageInputStreamImplIOException
public char readChar()
throws IOException
readChar in interface DataInputreadChar in interface ImageInputStreamreadChar in class ImageInputStreamImplIOException
public double readDouble()
throws IOException
readDouble in interface DataInputreadDouble in interface ImageInputStreamreadDouble in class ImageInputStreamImplIOException
public float readFloat()
throws IOException
readFloat in interface DataInputreadFloat in interface ImageInputStreamreadFloat in class ImageInputStreamImplIOException
public void readFully(byte[] b,
int off,
int len)
throws IOException
readFully in interface DataInputreadFully in interface ImageInputStreamreadFully in class ImageInputStreamImplIOException
public void readFully(byte[] b)
throws IOException
readFully in interface DataInputreadFully in interface ImageInputStreamreadFully in class ImageInputStreamImplIOException
public int readInt()
throws IOException
readInt in interface DataInputreadInt in interface ImageInputStreamreadInt in class ImageInputStreamImplIOException
public String readLine()
throws IOException
readLine in interface DataInputreadLine in interface ImageInputStreamreadLine in class ImageInputStreamImplIOExceptionpublic ByteOrder getByteOrder()
getByteOrder in interface ImageInputStreamgetByteOrder in class ImageInputStreamImpl
public long getStreamPosition()
throws IOException
getStreamPosition in interface ImageInputStreamgetStreamPosition in class ImageInputStreamImplIOException
public int read(byte[] b)
throws IOException
read in interface ImageInputStreamread in class ImageInputStreamImplIOException
public long skipBytes(long n)
throws IOException
skipBytes in interface ImageInputStreamskipBytes in class ImageInputStreamImplIOException
public long readLong()
throws IOException
readLong in interface DataInputreadLong in interface ImageInputStreamreadLong in class ImageInputStreamImplIOException
public short readShort()
throws IOException
readShort in interface DataInputreadShort in interface ImageInputStreamreadShort in class ImageInputStreamImplIOException
public int readUnsignedByte()
throws IOException
readUnsignedByte in interface DataInputreadUnsignedByte in interface ImageInputStreamreadUnsignedByte in class ImageInputStreamImplIOException
public long readUnsignedInt()
throws IOException
readUnsignedInt in interface ImageInputStreamreadUnsignedInt in class ImageInputStreamImplIOException
public int readUnsignedShort()
throws IOException
readUnsignedShort in interface DataInputreadUnsignedShort in interface ImageInputStreamreadUnsignedShort in class ImageInputStreamImplIOException
public String readUTF()
throws IOException
readUTF in interface DataInputreadUTF in interface ImageInputStreamreadUTF in class ImageInputStreamImplIOExceptionpublic void setByteOrder(ByteOrder byteOrder)
setByteOrder in interface ImageInputStreamsetByteOrder in class ImageInputStreamImpl
public int skipBytes(int n)
throws IOException
skipBytes in interface DataInputskipBytes in interface ImageInputStreamskipBytes in class ImageInputStreamImplIOException
public int read()
throws IOException
EnhancedRandomAccessFile.
read in interface ImageInputStreamread in class ImageInputStreamImplIOException
public 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 ImageInputStreamImplIOException
public void close()
throws IOException
EnhancedRandomAccessFile.
close 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()
FileImageInputStreamExtFileChannelImpl by closing its
underlying EnhancedRandomAccessFile.
public String toString()
ImageInputStream.
toString in class ObjectImageInputStream.public File getTarget()
AccessibleStream
getTarget in interface AccessibleStream<File>public Class<File> getBinding()
AccessibleStream
getBinding in interface AccessibleStream<File>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||