Package io.micronaut.core.io
Interface Streamable
- All Known Subinterfaces:
Writable
- All Known Implementing Classes:
ConfigurationMetadata
,PropertyMetadata
public interface Streamable
Interface for types that can be written to an
OutputStream
.- Since:
- 1.0
- Author:
- Graeme Rocher
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
default void
writeTo
(OutputStream outputStream) Write this object to the givenOutputStream
usingStandardCharsets.UTF_8
by default.void
writeTo
(OutputStream outputStream, @Nullable Charset charset) Write this object to the givenOutputStream
usingStandardCharsets.UTF_8
by default.
-
Method Details
-
writeTo
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:
IOException
- if an error occurred while outputting data to the writer
-
writeTo
- Parameters:
file
- The file- Throws:
IOException
- if an error occurred while outputting data to the writer
-
writeTo
Write this object to the givenOutputStream
usingStandardCharsets.UTF_8
by default.- Parameters:
outputStream
- The output stream- Throws:
IOException
- if an error occurred while outputting data to the writer
-