Package io.micronaut.core.io
Interface Streamable
-
- All Known Subinterfaces:
Writable
public interface Streamable
Interface for types that can be written to anOutputStream
.- Since:
- 1.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
writeTo(java.io.File file)
Write thisWritable
to the givenFile
.default void
writeTo(java.io.OutputStream outputStream)
Write this object to the givenOutputStream
usingStandardCharsets.UTF_8
by default.void
writeTo(java.io.OutputStream outputStream, java.nio.charset.Charset charset)
Write this object to the givenOutputStream
usingStandardCharsets.UTF_8
by default.
-
-
-
Method Detail
-
writeTo
void writeTo(java.io.OutputStream outputStream, @Nullable java.nio.charset.Charset charset) throws java.io.IOException
Write this object to the givenOutputStream
usingStandardCharsets.UTF_8
by default.- Parameters:
outputStream
- The output streamcharset
- The charset to use. Defaults toStandardCharsets.UTF_8
- Throws:
java.io.IOException
- if an error occurred while outputting data to the writer
-
writeTo
default void writeTo(java.io.File file) throws java.io.IOException
Write thisWritable
to the givenFile
.- Parameters:
file
- The file- Throws:
java.io.IOException
- if an error occurred while outputting data to the writer
-
writeTo
default void writeTo(java.io.OutputStream outputStream) throws java.io.IOException
Write this object to the givenOutputStream
usingStandardCharsets.UTF_8
by default.- Parameters:
outputStream
- The output stream- Throws:
java.io.IOException
- if an error occurred while outputting data to the writer
-
-