ImageInputStream
that gets its
input from a File
or RandomAccessFile
.
The file contents are assumed to be stable during the lifetime of
the object.
Modifier and Type | Field and Description |
---|---|
private final CloseableDisposerRecord | disposerRecord
The DisposerRecord that closes the underlying RandomAccessFile. |
private final Object | disposerReferent
The referent to be registered with the Disposer. |
private RandomAccessFile |
Access | Constructor and Description |
---|---|
public | FileImageInputStream(File
a f)File to read from.Constructs a |
public | FileImageInputStream(RandomAccessFile
a raf)RandomAccessFile to read from.Constructs a |
Modifier and Type | Method and Description |
---|---|
public void | close()
Overrides javax. Implements javax. |
protected void | finalize()
Overrides javax.
Deprecated
for removal since 9. Finalization has been deprecated for removal. See
Finalizes this object prior to garbage collection.
java. for background information and details
about migration options.
|
public long | Returns: the file length as along , or
-1 .Overrides javax. Implements javax. -1
if it is unknown.
|
public int | read()
Implements abstract javax. Implements javax. int between 0 and 255.
|
public int | read(byte[]
an array of bytes to be written to. b, int the starting position within off, int b to write to.the maximum number of bytes to read. len)Implements abstract javax. Implements javax. len bytes from the stream, and stores
them into b starting at index off .
|
public void | seek(long
a pos)long containing the desired file
pointer position.Overrides javax. Implements javax. |
disposerRecord | back to summary |
---|---|
private final CloseableDisposerRecord disposerRecord The DisposerRecord that closes the underlying RandomAccessFile. |
disposerReferent | back to summary |
---|---|
private final Object disposerReferent The referent to be registered with the Disposer. |
raf | back to summary |
---|---|
private RandomAccessFile raf |
FileImageInputStream | back to summary |
---|---|
public FileImageInputStream(File f) throws FileNotFoundException, IOException Constructs a The file contents must not change between the time this object is constructed and the time of the last call to a read method.
|
FileImageInputStream | back to summary |
---|---|
public FileImageInputStream(RandomAccessFile raf) Constructs a The file contents must not change between the time this object is constructed and the time of the last call to a read method.
|
close | back to summary |
---|---|
public void close() throws IOException Overrides javax. Implements javax. Doc from javax. Closes the stream. Attempts to access a stream that has been
closed may result in
|
finalize | back to summary |
---|---|
protected void finalize() throws Throwable Overrides javax. Doc from javax. Deprecated for removal since 9. Finalization has been deprecated for removal. See
Finalizes this object prior to garbage collection. The
|
length | back to summary |
---|---|
public long length() Overrides javax. Implements javax. Returns the length of the underlying file, or
|
read | back to summary |
---|---|
public int read() throws IOException Implements abstract javax. Implements javax. Doc from javax. Reads a single byte from the stream and returns it as an
Subclasses must provide an implementation for this method. The subclass implementation should update the stream position before exiting. The bit offset within the stream must be reset to zero before the read occurs.
|
read | back to summary |
---|---|
public int read(byte[] b, int off, int len) throws IOException Implements abstract javax. Implements javax. Doc from javax. Reads up to The bit offset within the stream must be reset to zero before the read occurs. Subclasses must provide an implementation for this method. The subclass implementation should update the stream position before exiting.
|
seek | back to summary |
---|---|
public void seek(long pos) throws IOException Overrides javax. Implements javax. Doc from javax. Sets the current stream position to the desired location. The next read will occur at this location. The bit offset is set to 0. An It is legal to seek past the end of the file;
a
|