|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectImageInputStreamImpl
FileImageInputStreamExtImpl
public class FileImageInputStreamExtImpl
An implementation of ImageInputStream
that gets its input from a
File
. The eraf contents are assumed to be stable during the lifetime
of the object.
Field Summary |
---|
Fields inherited from class ImageInputStreamImpl |
---|
bitOffset, byteOrder, flushedPos, streamPos |
Constructor Summary | |
---|---|
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 . |
Method Summary | |
---|---|
void |
close()
Closes the underlying EnhancedRandomAccessFile . |
void |
dispose()
Disposes this FileImageInputStreamExtImpl by closing its
underlying EnhancedRandomAccessFile . |
ByteOrder |
getByteOrder()
|
File |
getFile()
Retrieves the File we are connected to. |
long |
getStreamPosition()
|
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 . |
Methods inherited from class ImageInputStreamImpl |
---|
checkClosed, finalize, flush, flushBefore, getBitOffset, getFlushedPosition, 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, isCachedFile, isCachedMemory, mark, readBit, readBits, readBoolean, readBytes, readFully, readFully, readFully, readFully, readFully, readFully, reset, setBitOffset |
Constructor Detail |
---|
public 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.Method Detail |
---|
public byte readByte() throws IOException
readByte
in interface DataInput
readByte
in interface ImageInputStream
readByte
in class ImageInputStreamImpl
IOException
public char readChar() throws IOException
readChar
in interface DataInput
readChar
in interface ImageInputStream
readChar
in class ImageInputStreamImpl
IOException
public double readDouble() throws IOException
readDouble
in interface DataInput
readDouble
in interface ImageInputStream
readDouble
in class ImageInputStreamImpl
IOException
public float readFloat() throws IOException
readFloat
in interface DataInput
readFloat
in interface ImageInputStream
readFloat
in class ImageInputStreamImpl
IOException
public void readFully(byte[] b, int off, int len) throws IOException
readFully
in interface DataInput
readFully
in interface ImageInputStream
readFully
in class ImageInputStreamImpl
IOException
public void readFully(byte[] b) throws IOException
readFully
in interface DataInput
readFully
in interface ImageInputStream
readFully
in class ImageInputStreamImpl
IOException
public int readInt() throws IOException
readInt
in interface DataInput
readInt
in interface ImageInputStream
readInt
in class ImageInputStreamImpl
IOException
public String readLine() throws IOException
readLine
in interface DataInput
readLine
in interface ImageInputStream
readLine
in class ImageInputStreamImpl
IOException
public ByteOrder getByteOrder()
getByteOrder
in interface ImageInputStream
getByteOrder
in class ImageInputStreamImpl
public long getStreamPosition() throws IOException
getStreamPosition
in interface ImageInputStream
getStreamPosition
in class ImageInputStreamImpl
IOException
public boolean isCached()
isCached
in interface ImageInputStream
isCached
in class ImageInputStreamImpl
public int read(byte[] b) throws IOException
read
in interface ImageInputStream
read
in class ImageInputStreamImpl
IOException
public long skipBytes(long n) throws IOException
skipBytes
in interface ImageInputStream
skipBytes
in class ImageInputStreamImpl
IOException
public long readLong() throws IOException
readLong
in interface DataInput
readLong
in interface ImageInputStream
readLong
in class ImageInputStreamImpl
IOException
public short readShort() throws IOException
readShort
in interface DataInput
readShort
in interface ImageInputStream
readShort
in class ImageInputStreamImpl
IOException
public int readUnsignedByte() throws IOException
readUnsignedByte
in interface DataInput
readUnsignedByte
in interface ImageInputStream
readUnsignedByte
in class ImageInputStreamImpl
IOException
public long readUnsignedInt() throws IOException
readUnsignedInt
in interface ImageInputStream
readUnsignedInt
in class ImageInputStreamImpl
IOException
public int readUnsignedShort() throws IOException
readUnsignedShort
in interface DataInput
readUnsignedShort
in interface ImageInputStream
readUnsignedShort
in class ImageInputStreamImpl
IOException
public String readUTF() throws IOException
readUTF
in interface DataInput
readUTF
in interface ImageInputStream
readUTF
in class ImageInputStreamImpl
IOException
public void setByteOrder(ByteOrder byteOrder)
setByteOrder
in interface ImageInputStream
setByteOrder
in class ImageInputStreamImpl
public int skipBytes(int n) throws IOException
skipBytes
in interface DataInput
skipBytes
in interface ImageInputStream
skipBytes
in class ImageInputStreamImpl
IOException
public int read() throws IOException
EnhancedRandomAccessFile
.
read
in interface ImageInputStream
read
in class ImageInputStreamImpl
IOException
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 ImageInputStream
read
in class ImageInputStreamImpl
b
- the byte array to receive the bytes.off
- the offset in the array where copying will start.len
- the number of bytes to copy.
IOException
public long length()
-1
if it is
unknown.
length
in interface ImageInputStream
length
in class ImageInputStreamImpl
long
, or -1
.public void seek(long pos) throws IOException
seek
in interface ImageInputStream
seek
in class ImageInputStreamImpl
IOException
public void close() throws IOException
EnhancedRandomAccessFile
.
close
in interface ImageInputStream
close
in class ImageInputStreamImpl
IOException
- in case something bad happens.public File getFile()
File
we are connected to.
getFile
in interface FileImageInputStreamExt
File
public void dispose()
FileImageInputStreamExtImpl
by closing its
underlying EnhancedRandomAccessFile
.
public String toString()
ImageInputStream
.
toString
in class Object
ImageInputStream
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |