| java.lang.Object com.caucho.vfs.StreamImpl com.caucho.vfs.FileReadStream
Method Summary | |
public boolean | canRead() Returns true if there's an associated file. | public void | close() Closes the underlying stream. | public int | getAvailable() Returns the number of bytes available for reading. | public boolean | hasSkip() Returns true if there's an associated file. | public void | init(FileInputStream is) Initializes a VfsStream with an input/output stream pair. | public boolean | lock(boolean shared, boolean block) | public int | read(byte[] buf, int offset, int length) Reads bytes from the file.
Parameters: buf - a byte array receiving the data. Parameters: offset - starting index to receive data. Parameters: length - number of bytes to read. | public void | seekStart(long offset) Seeks based on the start. | public long | skip(long n) Skips bytes in the file. | public boolean | unlock() |
FileReadStream | public FileReadStream()(Code) | | Create a new FileReadStream.
|
FileReadStream | public FileReadStream(FileInputStream is)(Code) | | Create a new FileReadStream based on the java.io.* stream.
Parameters: is - the underlying input stream. |
FileReadStream | public FileReadStream(FileInputStream is, Path path)(Code) | | Create a new FileReadStream based on the java.io.* stream.
Parameters: is - the underlying input stream. Parameters: path - the associated Path. |
canRead | public boolean canRead()(Code) | | Returns true if there's an associated file.
|
getAvailable | public int getAvailable() throws IOException(Code) | | Returns the number of bytes available for reading.
|
hasSkip | public boolean hasSkip()(Code) | | Returns true if there's an associated file.
|
init | public void init(FileInputStream is)(Code) | | Initializes a VfsStream with an input/output stream pair. Before a
read, the output will be flushed to avoid deadlocks.
Parameters: is - the underlying InputStream. Parameters: os - the underlying OutputStream. |
lock | public boolean lock(boolean shared, boolean block)(Code) | | |
read | public int read(byte[] buf, int offset, int length) throws IOException(Code) | | Reads bytes from the file.
Parameters: buf - a byte array receiving the data. Parameters: offset - starting index to receive data. Parameters: length - number of bytes to read. the number of bytes read or -1 on end of file. |
seekStart | public void seekStart(long offset) throws IOException(Code) | | Seeks based on the start.
|
skip | public long skip(long n) throws IOException(Code) | | Skips bytes in the file.
Parameters: n - the number of bytes to skip the actual bytes skipped. |
unlock | public boolean unlock()(Code) | | |
Methods inherited from com.caucho.vfs.StreamImpl | public boolean canRead()(Code)(Java Doc) public boolean canWrite()(Code)(Java Doc) public void clearWrite()(Code)(Java Doc) public void close() throws IOException(Code)(Java Doc) public void closeWrite() throws IOException(Code)(Java Doc) public void flush() throws IOException(Code)(Java Doc) public void flushBuffer() throws IOException(Code)(Java Doc) public void flushToDisk() throws IOException(Code)(Java Doc) public Object getAttribute(String name) throws IOException(Code)(Java Doc) public Iterator getAttributeNames() throws IOException(Code)(Java Doc) public int getAvailable() throws IOException(Code)(Java Doc) public boolean getFlushOnNewline()(Code)(Java Doc) public byte[] getNewline()(Code)(Java Doc) public Path getPath()(Code)(Java Doc) public byte[] getReadBuffer()(Code)(Java Doc) public long getReadPosition()(Code)(Java Doc) public boolean hasSkip()(Code)(Java Doc) public int read(byte[] buffer, int offset, int length) throws IOException(Code)(Java Doc) public int readNonBlock(byte[] buffer, int offset, int length) throws IOException(Code)(Java Doc) public int readTimeout(byte[] buffer, int offset, int length, long timeout) throws IOException(Code)(Java Doc) public void removeAttribute(String name) throws IOException(Code)(Java Doc) public void seekEnd(long offset) throws IOException(Code)(Java Doc) public void seekStart(long offset) throws IOException(Code)(Java Doc) public void setAttribute(String name, Object value) throws IOException(Code)(Java Doc) public void setPath(Path path)(Code)(Java Doc) public void setWriteEncoding(String encoding)(Code)(Java Doc) public long skip(long n) throws IOException(Code)(Java Doc) public void write(byte[] buffer, int offset, int length, boolean isEnd) throws IOException(Code)(Java Doc) public boolean write(byte[] buf1, int off1, int len1, byte[] buf2, int off2, int len2, boolean isEnd) throws IOException(Code)(Java Doc)
|
|
|