|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.caucho.vfs.StreamImpl
com.caucho.vfs.JniFileStream
public class JniFileStream
Stream using with JNI.
| Field Summary |
|---|
| Fields inherited from class com.caucho.vfs.StreamImpl |
|---|
_nullPath, _path |
| Constructor Summary | |
|---|---|
JniFileStream(int fd,
boolean canRead,
boolean canWrite)
Create a new JniStream based on the java.io.* stream. |
|
| Method Summary | |
|---|---|
boolean |
canRead()
Returns true if this is a read stream. |
boolean |
canWrite()
Returns true if this is a writeable stream. |
void |
close()
Closes the stream. |
protected void |
finalize()
|
void |
flush()
Flushes the write output. |
void |
flushToDisk()
Flushes the write output, forcing to disk. |
int |
getAvailable()
Returns the number of bytes available without blocking. |
static java.lang.Throwable |
getDisableCause()
|
boolean |
hasSkip()
Returns true if the stream implements skip. |
static boolean |
isEnabled()
|
boolean |
lock(boolean shared,
boolean block)
Implement LockableStream as a no-op, but maintain compatibility with FileWriteStream and FileReadStream wrt returning false to indicate error case. |
static JniFileStream |
openRead(byte[] name,
int length)
|
static JniFileStream |
openWrite(byte[] name,
int length,
boolean isAppend)
|
int |
read(byte[] buf,
int offset,
int length)
Reads data from the file. |
void |
seekEnd(long offset)
Seeks based on the end. |
void |
seekStart(long offset)
Seeks based on the start. |
long |
skip(long length)
Skips a number of bytes, returning the bytes skipped. |
java.lang.String |
toString()
Returns the debug name for the stream. |
boolean |
unlock()
Unlock the advisory lock. |
void |
write(byte[] buf,
int offset,
int length,
boolean isEnd)
Writes data to the file. |
| Methods inherited from class com.caucho.vfs.StreamImpl |
|---|
clearWrite, closeWrite, flushBuffer, getAttribute, getAttributeNames, getFlushOnNewline, getNewline, getPath, getReadBuffer, getReadPosition, isClosed, isEof, readNonBlock, readTimeout, removeAttribute, setAttribute, setPath, setWriteEncoding, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public JniFileStream(int fd,
boolean canRead,
boolean canWrite)
| Method Detail |
|---|
public static boolean isEnabled()
public static java.lang.Throwable getDisableCause()
public static JniFileStream openRead(byte[] name,
int length)
public static JniFileStream openWrite(byte[] name,
int length,
boolean isAppend)
public boolean canRead()
StreamImpl
canRead in class StreamImplpublic boolean hasSkip()
StreamImpl
hasSkip in class StreamImpl
public long skip(long length)
throws java.io.IOException
StreamImpl
skip in class StreamImpllength - the number of types to skip.
java.io.IOException
public int read(byte[] buf,
int offset,
int length)
throws java.io.IOException
read in class StreamImplbuf - byte array receiving the data.offset - starting offset into the array.length - number of bytes to read.
java.io.IOException
public int getAvailable()
throws java.io.IOException
StreamImpl
getAvailable in class StreamImpljava.io.IOExceptionpublic boolean canWrite()
canWrite in class StreamImpl
public void write(byte[] buf,
int offset,
int length,
boolean isEnd)
throws java.io.IOException
write in class StreamImplbuf - 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.
java.io.IOException
public void seekStart(long offset)
throws java.io.IOException
StreamImpl
seekStart in class StreamImpljava.io.IOException
public void seekEnd(long offset)
throws java.io.IOException
StreamImpl
seekEnd in class StreamImpljava.io.IOException
public void flush()
throws java.io.IOException
StreamImpl
flush in class StreamImpljava.io.IOException
public void flushToDisk()
throws java.io.IOException
StreamImpl
flushToDisk in class StreamImpljava.io.IOException
public void close()
throws java.io.IOException
StreamImpl
close in class StreamImpljava.io.IOException
protected void finalize()
throws java.io.IOException
finalize in class java.lang.Objectjava.io.IOException
public boolean lock(boolean shared,
boolean block)
lock in interface LockableStreampublic boolean unlock()
LockableStream
unlock in interface LockableStreampublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||