|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.caucho.vfs.StreamImpl
This is the service provider's interface for a stream supported by the VFS.
Field Summary | |
protected static NullPath |
nullPath
|
protected Path |
path
|
Constructor Summary | |
StreamImpl()
|
Method Summary | |
boolean |
canRead()
Returns true if this is a read stream. |
boolean |
canWrite()
Returns true if this is a writable stream. |
void |
clearWrite()
Clears any buffered values in the write. |
void |
close()
Closes the stream. |
void |
flush()
Flushes the write output. |
java.lang.Object |
getAttribute(java.lang.String name)
Returns a stream attribute. |
java.util.Iterator |
getAttributeNames()
Returns an iterator of the attribute names. |
int |
getAvailable()
Returns the number of bytes available without blocking. |
boolean |
getFlushOnNewline()
Returns true if the buffer should be flushed on every newline. |
byte[] |
getNewline()
Returns the stream's natural newline character. |
Path |
getPath()
Returns the Path associated with the stream. |
long |
getReadPosition()
Returns the current read position of the underlying file. |
boolean |
hasSkip()
Returns true if the stream implements skip. |
int |
read(byte[] buffer,
int offset,
int length)
Reads the next chunk from the stream. |
void |
removeAttribute(java.lang.String name)
Removes a stream attribute. |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Sets a stream attribute. |
void |
setPath(Path path)
Sets the Path associated with the stream. |
long |
skip(long n)
Skips a number of bytes, returning the bytes skipped. |
void |
write(byte[] buffer,
int offset,
int length,
boolean isEnd)
Writes a buffer to the underlying stream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static NullPath nullPath
protected Path path
Constructor Detail |
public StreamImpl()
Method Detail |
public byte[] getNewline()
public boolean hasSkip()
public long skip(long n) throws java.io.IOException
n
- the number of types to skip.public boolean canRead()
public int read(byte[] buffer, int offset, int length) throws java.io.IOException
buffer
- byte array receiving the data.offset
- starting offset into the array.length
- number of bytes to read.public int getAvailable() throws java.io.IOException
public long getReadPosition()
public boolean canWrite()
public boolean getFlushOnNewline()
public void write(byte[] buffer, int offset, int length, boolean isEnd) throws java.io.IOException
buffer
- the byte array to write.offset
- the offset into the byte array.length
- the number of bytes to write.isEnd
- true when the write is flushing a close.public void clearWrite()
public void flush() throws java.io.IOException
public Path getPath()
public void setPath(Path path)
public java.lang.Object getAttribute(java.lang.String name) throws java.io.IOException
name
- the attribute name.public void setAttribute(java.lang.String name, java.lang.Object value) throws java.io.IOException
name
- the attribute name.value
- the attribute value.public void removeAttribute(java.lang.String name) throws java.io.IOException
name
- the attribute name.public java.util.Iterator getAttributeNames() throws java.io.IOException
public void close() throws java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |