Class ByteArrayOutputStreamProvider
java.lang.Object
com.helger.commons.io.streamprovider.ByteArrayOutputStreamProvider
- All Implemented Interfaces:
IHasOutputStream,IHasOutputStreamAndWriter
An
OutputStream provider based on a byte array.- Author:
- Philip Helger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal StringgetAsString(Charset aCharset) final byte[]getBytes()getOutputStream(EAppend eAppend) Get the output stream to read from the object.final booleanCheck if theOutputStreamfromIHasOutputStream.getOutputStream(EAppend)orIHasOutputStream.getBufferedOutputStream(EAppend)can be acquired more than once or not.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.helger.commons.io.IHasOutputStream
getBufferedOutputStreamMethods inherited from interface com.helger.commons.io.IHasOutputStreamAndWriter
getBufferedWriter, getWriter
-
Constructor Details
-
ByteArrayOutputStreamProvider
public ByteArrayOutputStreamProvider()
-
-
Method Details
-
getOutputStream
Description copied from interface:IHasOutputStreamGet the output stream to read from the object. Each time this method is call, a newOutputStreamneeds to be created!- Specified by:
getOutputStreamin interfaceIHasOutputStream- Parameters:
eAppend- appending mode. May not benull.- Returns:
nullif resolving failed.
-
isWriteMultiple
public final boolean isWriteMultiple()Description copied from interface:IHasOutputStreamCheck if theOutputStreamfromIHasOutputStream.getOutputStream(EAppend)orIHasOutputStream.getBufferedOutputStream(EAppend)can be acquired more than once or not.- Specified by:
isWriteMultiplein interfaceIHasOutputStream- Returns:
trueif the output stream can be acquired more than once,falseif not.
-
getBytes
- Returns:
- All bytes already written
-
getAsString
-
toString
-