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, writeSendfile
public void openWrite()
public byte[] getTail()
public void setEncoding(java.lang.String encoding)
public java.lang.String getEncoding()
public boolean canWrite()
StreamImpl
canWrite
in class StreamImpl
public void write(byte[] buf, int offset, int length, boolean isEnd) throws java.io.IOException
write
in interface TempStreamApi
write
in class StreamImpl
buf
- 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 flush() throws java.io.IOException
StreamImpl
flush
in class StreamImpl
java.io.IOException
public ReadStream openRead() throws java.io.IOException
openRead
in interface TempStreamApi
java.io.IOException
public ReadStream openReadAndSaveBuffer() throws java.io.IOException
free
- if true, frees the buffer as it's readjava.io.IOException
public void openRead(ReadStream rs) throws java.io.IOException
java.io.IOException
public java.io.InputStream getInputStream() throws java.io.IOException
java.io.IOException
public java.io.InputStream openInputStream() throws java.io.IOException
java.io.IOException
public TempBuffer getHead()
public void writeToStream(java.io.OutputStream os) throws java.io.IOException
java.io.IOException
public int getLength()
public void clearWrite()
StreamImpl
clearWrite
in class StreamImpl
public void discard()
public TempStream copy()
public void destroy()
destroy
in interface TempStreamApi