public class TempStream extends StreamImpl implements java.io.Serializable, TempStreamApi
_nullPath, _path| Constructor and Description |
|---|
TempStream() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canWrite()
Returns true if this is a writable stream.
|
void |
clearWrite()
Clears any buffered values in the write.
|
TempStream |
copy()
Copies the temp stream;
|
void |
destroy()
Clean up the temp stream.
|
void |
discard() |
void |
flush()
Flushes the write output.
|
java.lang.String |
getEncoding()
Gets the encoding.
|
TempBuffer |
getHead()
Returns the head buffer.
|
java.io.InputStream |
getInputStream()
Returns an input stream to the contents, freeing the value
automatically.
|
int |
getLength()
Returns the total length of the buffer's bytes
|
byte[] |
getTail() |
java.io.InputStream |
openInputStream() |
ReadStream |
openRead()
Opens a read stream to the buffer.
|
void |
openRead(ReadStream rs)
Opens a read stream to the buffer.
|
ReadStream |
openReadAndSaveBuffer()
Opens a read stream to the buffer.
|
void |
openWrite()
Initializes the temp stream for writing.
|
void |
setEncoding(java.lang.String encoding)
Sets the encoding.
|
void |
write(byte[] buf,
int offset,
int length,
boolean isEnd)
Writes a chunk of data to the temp stream.
|
void |
writeToStream(java.io.OutputStream os) |
canRead, close, closeWrite, flushBuffer, flushToDisk, getAttribute, getAttributeNames, getAvailable, getFlushOnNewline, getNewline, getPath, getReadBuffer, getReadPosition, hasSkip, isClosed, isEof, isMmapEnabled, isSendfileEnabled, read, readNonBlock, readTimeout, removeAttribute, seekEnd, seekStart, setAttribute, setPath, setWriteEncoding, skip, write, writeMmap, writeSendfilepublic void openWrite()
public byte[] getTail()
public void setEncoding(java.lang.String encoding)
public java.lang.String getEncoding()
public boolean canWrite()
StreamImplcanWrite in class StreamImplpublic void write(byte[] buf,
int offset,
int length,
boolean isEnd)
throws java.io.IOException
write in interface TempStreamApiwrite 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.IOExceptionpublic void flush()
throws java.io.IOException
StreamImplflush in class StreamImpljava.io.IOExceptionpublic ReadStream openRead() throws java.io.IOException
openRead in interface TempStreamApijava.io.IOExceptionpublic ReadStream openReadAndSaveBuffer() throws java.io.IOException
free - if true, frees the buffer as it's readjava.io.IOExceptionpublic void openRead(ReadStream rs) throws java.io.IOException
java.io.IOExceptionpublic java.io.InputStream getInputStream()
throws java.io.IOException
java.io.IOExceptionpublic java.io.InputStream openInputStream()
throws java.io.IOException
java.io.IOExceptionpublic TempBuffer getHead()
public void writeToStream(java.io.OutputStream os)
throws java.io.IOException
java.io.IOExceptionpublic int getLength()
public void clearWrite()
StreamImplclearWrite in class StreamImplpublic void discard()
public TempStream copy()
public void destroy()
destroy in interface TempStreamApi