Package io.micronaut.core.io
Interface Writable
- All Superinterfaces:
Streamable
- All Known Implementing Classes:
ConfigurationMetadata
,PropertyMetadata
An interface for classes to implement that are capable of writing themselves to a Writer
- 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.default void
writeTo
(OutputStream outputStream, @Nullable Charset charset) Write this object to the givenOutputStream
usingStandardCharsets.UTF_8
by default.void
Writes this object to the given writer.
-
Method Details
-
writeTo
Writes this object to the given writer.- Parameters:
out
- the Writer to which this Writable should output its data.- Throws:
IOException
- if an error occurred while outputting data to the writer
-
writeTo
Write this object to the givenOutputStream
usingStandardCharsets.UTF_8
by default.- Specified by:
writeTo
in interfaceStreamable
- Parameters:
outputStream
- The output stream- Throws:
IOException
- if an error occurred while outputting data to the writer
-
writeTo
- Specified by:
writeTo
in interfaceStreamable
- Parameters:
file
- The file- Throws:
IOException
- if an error occurred while outputting data to the writer
-
writeTo
default void writeTo(OutputStream outputStream, @Nullable @Nullable Charset charset) throws IOException Write this object to the givenOutputStream
usingStandardCharsets.UTF_8
by default.- Specified by:
writeTo
in interfaceStreamable
- 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
-