public class OutputDataStream
extends java.io.OutputStream
implements java.lang.AutoCloseable
OutputDataStream
object allows you to write bytes to a data stream.Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this output stream and releases any system resources associated with the stream.
|
void |
flush()
Flushes this output stream and forces any buffered output bytes to be written out.
|
CumulusSession |
getCumulusSession()
Returns the current
CumulusSession object. |
long |
getPos()
Returns the current position in this output stream.
|
long |
getSize()
Returns the number of bytes contained in this output stream.
|
void |
movePos(long delta)
Sets the current position in this output stream relative to the current position.
|
void |
setPos(long pos)
Sets the current position in this output stream.
|
void |
write(byte[] byteData,
int off,
int len)
Writes
len bytes from the specified byte array starting at offset off to this output stream. |
void |
write(int byteData)
Writes the specified byte to this output stream.The general contract for
write is that one byte is written to the output stream. |
public CumulusSession getCumulusSession()
CumulusSession
object.CumulusSession
objectpublic void write(int byteData)
write
is that one byte is written to the output stream. The byte to be
written is the eight low-order bits of the argument byteData
. The 24
high-order bits of byteData
are ignored.write
in class java.io.OutputStream
byteData
- the byte
.public void write(byte[] byteData, int off, int len)
len
bytes from the specified byte array starting at offset off
to this output stream. The general contract for write(byteData, off, len)
is that some of the bytes in the array byteData
are written to the output stream in order; element byteData[off]
is the first byte written and byteData[off+len-1]
is the last byte written by this operation.
If off
is negative, or len
is negative, or off+len
is greater than the length of the array byteData
, then an
IndexOutOfBoundsException is thrown.write
in class java.io.OutputStream
byteData
- the data.off
- the start offset in the data.len
- the number of bytes to write.public void flush()
flush
is that calling it is an
indication that, if any bytes previously written have been buffered by the implementation of the output stream, such bytes should immediately be written
to their intended destination.flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.OutputStream
public long getSize()
public long getPos()
public void setPos(long pos)
pos
- the new position relative to the beginning of the stream.public void movePos(long delta)
delta
- the new position relative to the current position.www.canto.com
Canto, the Canto logo, the Cumulus logo, and Cumulus are registered trademarks of Canto GmbH, registered in the U.S. and other countries.