public class DatastoreReadStream extends StreamImpl implements LockableStream
_nullPath, _path| Constructor and Description |
|---|
DatastoreReadStream()
Create a new FileReadStream.
|
DatastoreReadStream(DatastoreInputStream is)
Create a new FileReadStream based on the java.io.* stream.
|
DatastoreReadStream(DatastoreInputStream is,
DatastorePath path)
Create a new FileReadStream based on the java.io.* stream.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canRead()
Returns true if there's an associated file.
|
void |
close()
Closes the underlying stream.
|
int |
getAvailable()
Returns the number of bytes available for reading.
|
boolean |
hasSkip()
Returns true if there's an associated file.
|
void |
init(DatastoreInputStream is)
Initializes a VfsStream with an input/output stream pair.
|
boolean |
lock(boolean shared,
boolean block)
Lock the shared advisory lock.
|
int |
read(byte[] buf,
int offset,
int length)
Reads bytes from the file.
|
void |
seekStart(long offset)
Seeks based on the start.
|
long |
skip(long n)
Skips bytes in the file.
|
boolean |
unlock()
Unlock the advisory lock.
|
canWrite, clearWrite, closeWrite, flush, flushBuffer, flushToDisk, getAttribute, getAttributeNames, getFlushOnNewline, getNewline, getPath, getReadBuffer, getReadPosition, isClosed, isEof, isMmapEnabled, isSendfileEnabled, readNonBlock, readTimeout, removeAttribute, seekEnd, setAttribute, setPath, setWriteEncoding, write, write, writeMmap, writeSendfilepublic DatastoreReadStream()
public DatastoreReadStream(DatastoreInputStream is)
is - the underlying input stream.public DatastoreReadStream(DatastoreInputStream is, DatastorePath path)
is - the underlying input stream.path - the associated Path.public void init(DatastoreInputStream is)
is - the underlying InputStream.os - the underlying OutputStream.public boolean hasSkip()
hasSkip in class StreamImplpublic long skip(long n)
throws java.io.IOException
skip in class StreamImpln - the number of bytes to skipjava.io.IOExceptionpublic void seekStart(long offset)
throws java.io.IOException
seekStart in class StreamImpljava.io.IOExceptionpublic boolean canRead()
canRead in class StreamImplpublic int read(byte[] buf,
int offset,
int length)
throws java.io.IOException
read in class StreamImplbuf - a byte array receiving the data.offset - starting index to receive data.length - number of bytes to read.java.io.IOExceptionpublic int getAvailable()
throws java.io.IOException
getAvailable in class StreamImpljava.io.IOExceptionpublic void close()
throws java.io.IOException
close in class StreamImpljava.io.IOExceptionpublic boolean lock(boolean shared,
boolean block)
LockableStreamlock in interface LockableStreampublic boolean unlock()
LockableStreamunlock in interface LockableStream