Package com.helger.commons.io
Interface IWriteToStream
-
- All Known Implementing Classes:
ByteBufferOutputStream,NonBlockingByteArrayOutputStream
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface IWriteToStream
A simple interface for objects that can write to anOutputStream.- Author:
- Philip Helger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidwriteTo(OutputStream aOS)Write everything to the passed output stream.default voidwriteToAndClose(OutputStream aOS)Write everything to the passed output stream and close it.
-
-
-
Method Detail
-
writeTo
void writeTo(@Nonnull @WillNotClose OutputStream aOS) throws IOException
Write everything to the passed output stream.- Parameters:
aOS- The output stream to write to. May not benull. The OutputStream must not closed by implementations of this class.- Throws:
IOException- In case of IO error
-
writeToAndClose
default void writeToAndClose(@Nonnull @WillClose OutputStream aOS) throws IOException
Write everything to the passed output stream and close it.- Parameters:
aOS- The output stream to write to. May not benull.- Throws:
IOException- In case of IO error. Even than the OutputStream is closed!
-
-