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 voiddefault voidwriteTo(OutputStream outputStream) Write this object to the givenOutputStreamusingStandardCharsets.UTF_8by default.default voidwriteTo(OutputStream outputStream, @Nullable Charset charset) Write this object to the givenOutputStreamusingStandardCharsets.UTF_8by default.voidWrites 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 givenOutputStreamusingStandardCharsets.UTF_8by default.- Specified by:
writeToin interfaceStreamable- Parameters:
outputStream- The output stream- Throws:
IOException- if an error occurred while outputting data to the writer
-
writeTo
- Specified by:
writeToin 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 givenOutputStreamusingStandardCharsets.UTF_8by default.- Specified by:
writeToin 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
-