|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
com.intersys.objects.CacheInputStream
A CacheInputStream
obtains input bytes from a Cache
Database. Usually it is mapped to some global in Cache. This is a
wrapper class around GlobalBinaryStream
. Note, that if
you use this wrapper class it is not reommended to use direct calls
to GlobalBinaryStream
.
BinaryStream
in Cache ,
GlobalBinaryStream
,
Serialized FormConstructor Summary | |
CacheInputStream(BinaryStream stream)
|
Method Summary | |
int |
available()
|
void |
close()
|
void |
mark(int readlimit)
Marks the current position in this input stream. |
boolean |
markSupported()
|
int |
read()
|
int |
read(byte[] b,
int off,
int len)
|
byte[] |
read(int len)
|
void |
reset()
Repositions this stream to the position at the time the mark method was last called on this input stream. |
void |
rewind()
Rewinds stream, so the next byte will be the first byte stored in this Cache Stream (the first byte stored in global). |
void |
seek(long pos)
Repositions this stream to the given position. |
long |
skip(long n)
Skips over and discards n bytes of data from this input
stream. |
long |
tell()
Returns the current position in the stream. |
Methods inherited from class java.io.InputStream |
read |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CacheInputStream(BinaryStream stream) throws CacheException
Method Detail |
public int read(byte[] b, int off, int len) throws IOException
IOException
public int read() throws IOException
IOException
public void rewind() throws CacheException
CacheException
public long tell()
Note, this method works only if all calls to the underlying
GlobalBinaryStream
goes through this
CacheInputStream
object.
seek(long)
,
rewind()
,
mark(int)
,
reset()
,
GlobalBinaryStream
public boolean markSupported()
public void mark(int readlimit)
reset
method repositions this stream at the last marked
position so that subsequent reads re-read the same bytes.
Note, this method works only if all calls to the underlying
GlobalBinaryStream
goes through this
CacheInputStream
object.
readlimit
- Ignored.seek(long)
,
rewind()
,
tell()
,
reset()
public void reset() throws IOException
mark
method was last called on this input stream.
Note, this method works only if all calls to the underlying
GlobalBinaryStream
goes through this
CacheInputStream
object.
IOException
mark(int)
,
seek(long)
,
rewind()
,
tell()
public void seek(long pos) throws IOException
Note, this method works only if all calls to the underlying
GlobalBinaryStream
goes through this
CacheInputStream
object.
pos
- New postition for the stream.
IOException
mark(int)
,
seek(long)
,
rewind()
,
tell()
public long skip(long n) throws IOException
n
bytes of data from this input
stream. The skip
method may, for a variety of reasons, end
up skipping over some smaller number of bytes, possibly 0
.
This may result from any of a number of conditions; reaching end of file
before n
bytes have been skipped is only one possibility.
The actual number of bytes skipped is returned. If n
is
negative, no bytes are skipped.
n
- the number of bytes to be skipped.
IOException
- if an I/O error occurs.public byte[] read(int len) throws IOException
IOException
public int available() throws IOException
IOException
public void close() throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |