public class InputDataStream
extends java.io.InputStream
implements java.lang.AutoCloseable
InputDataStream
object allows you to read bytes from a data stream.Modifier and Type | Method and Description |
---|---|
int |
available()
Returns the number of bytes that can be read (or skipped over) from the current position.
|
void |
close()
Closes this input stream and releases any system resources associated with the stream.
|
CumulusSession |
getCumulusSession()
Returns the current
CumulusSession object. |
long |
getPos()
Returns the current position in this input stream.
|
long |
getSize()
Returns the number of bytes that can be read from this input stream.
|
void |
movePos(long delta)
Sets the current position in this input stream relative to the current position.
|
int |
read()
Reads the next byte of data from the input stream.
|
int |
read(byte[] data,
int off,
int len)
Reads up to len bytes of data into an array of bytes from this input stream.
|
void |
setPos(long pos)
Sets the current position in this input stream.
|
long |
skip(long bytesToSkip)
Skips bytesToSkip bytes of input from this input stream.
|
public CumulusSession getCumulusSession()
CumulusSession
object.CumulusSession
objectpublic int read()
0
to 255
. If no byte is available
because the end of the stream has been reached, the value -1
is returned. This method blocks until input data is available, the end of the stream
is detected, or an exception is thrown.read
in class java.io.InputStream
-1
if the end of the stream is reached.public int read(byte[] data, int off, int len)
-1
is returned to indicate end of file.
Otherwise, the number k of bytes read is equal to the smaller of len
and count-pos
.read
in class java.io.InputStream
data
- the buffer into which the data is read.off
- the start offset in array data
at which the data is written.len
- the maximum number of bytes to read.-1
if there is no more data because the end of the stream has been reached.public long skip(long bytesToSkip)
bytesToSkip
and count-pos
. The value k is added into pos
and k is returned.skip
in class java.io.InputStream
public int available()
available
in class java.io.InputStream
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.InputStream
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.