java.lang.Object
i2p.susi.util.OutputStreamBuffer
- All Implemented Interfaces:
Buffer
Field Summary
FieldsConstructor Summary
ConstructorsConstructorDescriptionCreate an OutputStreamBuffer wrapping the given output stream.Method Summary
All MethodsModifier and TypeMethodDescriptionThis class only forwards writes to the wrapped stream, so it exposes no readable data of its own.intBytes written so far.intCurrent write position in the array.Stream that collects writes into the buffer.voidreadComplete(boolean success) Does nothing.toString()voidwriteComplete(boolean success) Close the output stream.
Field Details
_out
Where the buffered bytes are written.
Constructor Details
OutputStreamBuffer
Create an OutputStreamBuffer wrapping the given output stream.- Parameters:
out- the output stream to write to
Method Details
getInputStream
This class only forwards writes to the wrapped stream, so it exposes no readable data of its own.- Specified by:
getInputStreamin interfaceBuffer- Returns:
- InputStream for reading
- Throws:
UnsupportedOperationException- always, since there is nothing to read
getOutputStream
Stream that collects writes into the buffer.- Specified by:
getOutputStreamin interfaceBuffer- Returns:
- the same OutputStream that was passed to the constructor
readComplete
public void readComplete(boolean success) Does nothing.- Specified by:
readCompletein interfaceBuffer- Parameters:
success- if false, the read is considered failed
writeComplete
public void writeComplete(boolean success) Close the output stream.- Specified by:
writeCompletein interfaceBuffer- Parameters:
success- ignored; the stream is closed unconditionally
getLength
getOffset
toString