com.caucho.vfs
Class Crc64Stream

java.lang.Object
  extended by com.caucho.vfs.StreamImpl
      extended by com.caucho.vfs.Crc64Stream

public class Crc64Stream
extends StreamImpl


Field Summary
 
Fields inherited from class com.caucho.vfs.StreamImpl
_nullPath, _path
 
Constructor Summary
Crc64Stream()
           
Crc64Stream(StreamImpl next)
           
 
Method Summary
 boolean canRead()
          Returns true if the stream can read.
 boolean canWrite()
          Returns true if the stream can write.
 void clearWrite()
          Clears any buffered values in the write.
 void close()
          Closes the stream output.
 void closeWrite()
          Closes the write output.
 void flush()
          Flushes the write output.
 long getCRC()
          Returns the CRC value.
 Path getPath()
          Returns the path.
 void init(StreamImpl next)
          Initialize the filter with a new stream.
 int read(byte[] buffer, int offset, int length)
          Reads a buffer from the underlying stream.
 void setPath(Path path)
          Sets the path.
 void write(byte[] buffer, int offset, int length, boolean isEnd)
          Writes a buffer to the underlying stream.
 
Methods inherited from class com.caucho.vfs.StreamImpl
flushBuffer, flushToDisk, getAttribute, getAttributeNames, getAvailable, getFlushOnNewline, getNewline, getReadBuffer, getReadPosition, hasSkip, isClosed, isEof, readNonBlock, readTimeout, removeAttribute, seekEnd, seekStart, setAttribute, setWriteEncoding, skip, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Crc64Stream

public Crc64Stream(StreamImpl next)

Crc64Stream

public Crc64Stream()
Method Detail

init

public void init(StreamImpl next)
Initialize the filter with a new stream.


getCRC

public long getCRC()
Returns the CRC value.


canRead

public boolean canRead()
Returns true if the stream can read.

Overrides:
canRead in class StreamImpl

read

public int read(byte[] buffer,
                int offset,
                int length)
         throws java.io.IOException
Reads a buffer from the underlying stream.

Overrides:
read in class StreamImpl
Parameters:
buffer - the byte array to read.
offset - the offset into the byte array.
length - the number of bytes to read.
Returns:
the number of bytes read or -1 on end of file.
Throws:
java.io.IOException

canWrite

public boolean canWrite()
Returns true if the stream can write.

Overrides:
canWrite in class StreamImpl

write

public void write(byte[] buffer,
                  int offset,
                  int length,
                  boolean isEnd)
           throws java.io.IOException
Writes a buffer to the underlying stream.

Overrides:
write in class StreamImpl
Parameters:
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.
Throws:
java.io.IOException

clearWrite

public void clearWrite()
Clears any buffered values in the write.

Overrides:
clearWrite in class StreamImpl

flush

public void flush()
           throws java.io.IOException
Flushes the write output.

Overrides:
flush in class StreamImpl
Throws:
java.io.IOException

closeWrite

public void closeWrite()
                throws java.io.IOException
Closes the write output.

Overrides:
closeWrite in class StreamImpl
Throws:
java.io.IOException

getPath

public Path getPath()
Returns the path.

Overrides:
getPath in class StreamImpl

setPath

public void setPath(Path path)
Sets the path.

Overrides:
setPath in class StreamImpl

close

public void close()
           throws java.io.IOException
Closes the stream output.

Overrides:
close in class StreamImpl
Throws:
java.io.IOException