|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
org.netbeans.mdr.persistence.btreeimpl.btreestorage.CachedPageInputStream
public class CachedPageInputStream
A stream composed of segments stored in CachedPages. The pages are pinned while members of a CachedPageInputStream. When done with the stream, close it to unpin the pages.
Constructor Summary | |
---|---|
CachedPageInputStream()
|
Method Summary | |
---|---|
void |
addPage(CachedPage pg,
int offst,
int len)
Add a page to the stream |
int |
available()
report how many bytes are still unread |
void |
close()
close the stream. |
protected void |
finalize()
if the stream was never closed, unpin the pages now |
void |
mark(int readlimit)
mark a spot in the stream, which reset will return to |
boolean |
markSupported()
this class supports mark (since it's easy) |
int |
read()
read a byte from the stream |
int |
read(byte[] b)
read bytes into an array |
int |
read(byte[] b,
int offset,
int length)
read bytes into an array |
void |
reset()
return to where mark was last called, or to the beginning if mark was never called. |
Methods inherited from class java.io.InputStream |
---|
skip |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CachedPageInputStream()
Method Detail |
---|
public void addPage(CachedPage pg, int offst, int len)
pg
- the page to addoffst
- the offset in the page where the stream data beginspublic void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.InputStream
java.io.IOException
- if there is an error unpinning the pages.public int read()
read
in class java.io.InputStream
public int read(byte[] b)
read
in class java.io.InputStream
b
- up to b.length bytes are read into this array
public int read(byte[] b, int offset, int length)
read
in class java.io.InputStream
b
- up to length bytes are read into this arrayoffset
- the offset into the array at whch to start storing bytesmaximum
- number of bytes to read
public boolean markSupported()
markSupported
in class java.io.InputStream
public void mark(int readlimit)
mark
in class java.io.InputStream
readlimit
- ignoredpublic int available()
available
in class java.io.InputStream
public void reset()
reset
in class java.io.InputStream
protected void finalize() throws StorageException
finalize
in class java.lang.Object
StorageException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |