ImageOutputStream that writes its
output directly to a File or
RandomAccessFile.
| 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 | FileImageOutputStream(File
a f)File to write to.Constructs a |
| public | FileImageOutputStream(RandomAccessFile
a raf)RandomAccessFile to write to.Constructs a |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Overrides javax. Implements javax. Closes the stream. |
| public long | length()
Overrides javax. Implements javax. Returns the total length of the stream, if known. |
| public int | read()
Implements abstract javax. Implements javax. Reads a single byte from the stream and returns it as an integer between 0 and 255. |
| public int | read(byte[] b, int off, int len)
Implements abstract javax. Implements javax. Reads up to |
| public void | seek(long pos)
Overrides javax. Implements javax. Sets the current stream position and resets the bit offset to 0. |
| public void | write(int b)
Implements abstract javax. Implements javax. Writes a single byte to the stream at the current position. |
| public void | write(byte[] b, int off, int len)
Implements abstract javax. Implements javax. Writes a sequence of bytes to the stream at the current position. |
| 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 | |
| FileImageOutputStream | back to summary |
|---|---|
| public FileImageOutputStream(File f) throws FileNotFoundException, IOException Constructs a
| |
| FileImageOutputStream | back to summary |
|---|---|
| public FileImageOutputStream(RandomAccessFile raf) Constructs a
| |
| 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
| |
| length | back to summary |
|---|---|
| public long length() Overrides javax. Implements javax. Doc from javax. Returns the total length of the stream, if known. Otherwise,
| |
| 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 integer between 0 and 255. If the end of the stream is reached, -1 is returned. The bit offset within the stream is 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 is reset to zero before the read occurs.
| |
| seek | back to summary |
|---|---|
| public void seek(long pos) throws IOException Overrides javax. Implements javax. Sets the current stream position and resets the bit offset to
0. It is legal to seeking past the end of the file; an
| |
| write | back to summary |
|---|---|
| public void write(int b) throws IOException Implements abstract javax. Implements javax. Doc from javax. Writes a single byte to the stream at the current position.
The 24 high-order bits of If the bit offset within the stream is non-zero, the
remainder of the current byte is padded with 0s
and written out first. The bit offset will be 0 after the
write. Implementers can use the
| |
| write | back to summary |
|---|---|
| public void write(byte[] b, int off, int len) throws IOException Implements abstract javax. Implements javax. Doc from javax. Writes a sequence of bytes to the stream at the current
position. If If the bit offset within the stream is non-zero, the
remainder of the current byte is padded with 0s
and written out first. The bit offset will be 0 after the
write. Implementers can use the
| |