|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.alachisoft.ncache.web.caching.CacheStream
public final class CacheStream
CacheStream is derived from System.IO.Stream. It is designed to put/fetch BLOB using standard Stream interface.
Method Summary | |
---|---|
boolean |
canRead()
Check whether stream supports reading. |
boolean |
canSeek()
Gets a value indicating whether the current stream supports seeking. |
boolean |
canWrite()
Gets a value indicating whether the current stream supports writing. |
void |
close()
Closes the current stream and releases any resources associated with the current stream. |
void |
flush()
|
java.io.BufferedInputStream |
getBufferedInputStream()
Gets java.io.BufferedInputStream of given buffer size. |
java.io.BufferedInputStream |
getBufferedInputStream(int bufferSize)
Gets java.io.BufferedInputStream of given buffer size. |
java.io.BufferedOutputStream |
getBufferedOutputStream()
Gets java.io.BufferedOutputStream of given buffer size. |
java.io.BufferedOutputStream |
getBufferedOutputStream(int bufferSize)
Gets java.io.BufferedOutputStream of given buffer size. |
long |
length()
Gets the length of the stream. |
long |
position()
Gets the position within current stream. |
int |
read(byte[] buffer,
int offset,
int count)
Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read. |
long |
seek(long offset)
Sets the position within the current stream. |
void |
setLength(long value)
Sets the length of the stream. |
void |
write(byte[] buffer,
int offset,
int count)
Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public boolean canRead()
public boolean canSeek()
public boolean canWrite()
public void close() throws java.lang.Exception
java.lang.Exception
public void flush()
public java.io.BufferedInputStream getBufferedInputStream() throws java.lang.Exception
java.lang.Exception
public java.io.BufferedInputStream getBufferedInputStream(int bufferSize) throws java.lang.Exception
bufferSize
- size of of buffer stream
java.lang.Exception
public java.io.BufferedOutputStream getBufferedOutputStream() throws java.lang.Exception
bufferSize
- size of of buffer stream
java.lang.Exception
public java.io.BufferedOutputStream getBufferedOutputStream(int bufferSize) throws java.lang.Exception
bufferSize
- size of of buffer stream
java.lang.Exception
public long length() throws java.lang.Exception
java.lang.Exception
public long position() throws java.lang.Exception
java.lang.Exception
public int read(byte[] buffer, int offset, int count) throws java.lang.Exception
buffer
- An array of bytes. When this method returns, the buffer contains the specified
byte array with the values between offset and (offset + count - 1) replaced by the bytes read from the current source.offset
- The zero-based byte offset in buffer at which to begin storing the data read from the current stream.count
- The maximum number of bytes to be read from the current stream.
java.lang.Exception
public long seek(long offset) throws NotSupportedException
offset
- A value of type SeekOrigin indicating the reference point used to obtain the new position.
NotSupportedException
- Stream does not support seekingpublic void setLength(long value) throws NotSupportedException
value
- The desired length of the current stream in bytes.
NotSupportedException
- Stream does not support both writing and seekingpublic void write(byte[] buffer, int offset, int count) throws java.lang.Exception
buffer
- An array of bytes. This method copies count bytes from buffer to the current stream.offset
- The zero-based byte offset in buffer at which to begin copying bytes to the current stream.count
- The number of bytes to be written to the current stream.
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |