public class CachedPageInputStream
extends java.io.InputStream
| Constructor and Description |
|---|
CachedPageInputStream() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
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.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.InputStreamjava.io.IOException - if there is an error unpinning the pages.public int read()
read in class java.io.InputStreampublic int read(byte[] b)
read in class java.io.InputStreamb - up to b.length bytes are read into this arraypublic int read(byte[] b,
int offset,
int length)
read in class java.io.InputStreamb - up to length bytes are read into this arrayoffset - the offset into the array at whch to start storing bytesmaximum - number of bytes to readpublic boolean markSupported()
markSupported in class java.io.InputStreampublic void mark(int readlimit)
mark in class java.io.InputStreamreadlimit - ignoredpublic int available()
available in class java.io.InputStreampublic void reset()
reset in class java.io.InputStreamprotected void finalize()
throws StorageException
finalize in class java.lang.ObjectStorageExceptionCopyright © 2005-2012 Apache Software Foundation. All Rights Reserved.