|
Oracle® Multimedia Java API Reference 11g Release 2 (11.2) E10779-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
java.io.OutputStream
oracle.ord.media.jai.io.SeekableOutputStream
oracle.ord.media.jai.io.MemoryCacheSeekableOutputStream
public class MemoryCacheSeekableOutputStream
A SeekableOutputStream class that writes to a generic output stream.
Constructor Summary | |
---|---|
MemoryCacheSeekableOutputStream(java.io.OutputStream os) Creates a MemoryCacheSeekableOutputStream object from an OutputStream object. |
Method Summary | |
---|---|
void |
close() Closes this output stream and releases any resources associated with this stream. |
void |
flush() Flushes the output stream and forces any buffered output bytes to be written to the stream. |
long |
getFilePointer() Returns the offset in the stream. |
long |
getFlushedPointer() Returns the position in the output stream after the last call to the flush method. |
long |
length() Returns the current length of the stream. |
void |
seek(long pos) Sets the file-pointer offset, measured from the beginning of this stream, at which the next write operation will occur. |
void |
truncate(long len) Truncates the stream to the specified length. |
void |
write(byte[] b) Writes all bytes in the specified byte array to the stream. |
void |
write(byte[] b, int off, int len) Writes the specified number of bytes from the specified byte array to the stream. |
void |
write(int b) Writes the specified byte to the stream. |
Methods inherited from class oracle.ord.media.jai.io.SeekableOutputStream |
---|
wrapOutputStream |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MemoryCacheSeekableOutputStream(java.io.OutputStream os) throws java.io.IOException
os
- an empty OutputStream object whose current stream position is zero, to which data will be written.java.io.IOException
Method Detail |
---|
public long length() throws java.io.IOException
length
in class SeekableOutputStream
java.io.IOException
- if an IO error occurs.public long getFilePointer() throws java.io.IOException
getFilePointer
in class SeekableOutputStream
java.io.IOException
- if an IO error occurs.public long getFlushedPointer() throws java.io.IOException
java.io.IOException
- if an IO error occurspublic void seek(long pos) throws java.io.IOException
The offset may be set beyond the end of the stream. Setting the offset beyond the end of the stream does not change the stream length; the stream length will change only by writing after the offset has been set beyond the end of the stream.
seek
in class SeekableOutputStream
pos
- the offset position, measured in bytes from the beginning of the stream, at which to set the file pointer.java.io.IOException
- if the value of the pos parameter is less than zero or if an IO error occurs.public void truncate(long len) throws java.io.IOException
truncate
in class SeekableOutputStream
len
- the length of the stream, in bytes.java.io.IOException
- if the value of the len parameter is less than zero or larger than the stream length, or if an IO error occurs.public void write(int b) throws java.io.IOException
write
in class java.io.OutputStream
b
- the byte to be written to the stream. Only the low-order byte is written; the upper 24 bits are ignored.java.io.IOException
- if an IO error occurs.public void write(byte[] b) throws java.io.IOException
write
in class java.io.OutputStream
b
- an array of bytes to be written to the stream.java.io.IOException
- if an IO error occurs.public void write(byte[] b, int off, int len) throws java.io.IOException
write
in class java.io.OutputStream
b
- the buffer containing the data to be written to the stream.off
- the starting position for the offset in the buffer.len
- the number of bytes to write to the stream.java.io.IOException
- if an IO error occurs.public void flush() throws java.io.IOException
There is little need to call this method until all the data has been written because the close method includes a call to the flush method.
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
- if an IO error occurs.public void close() throws java.io.IOException
flush()
method to write any buffered bytes to the stream.close
in interface java.io.Closeable
close
in class java.io.OutputStream
java.io.IOException
- if an IO error occurs.
|
Oracle® Multimedia Java API Reference 11g Release 2 (11.2) E10779-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |