Interface DataFormat
- All Superinterfaces:
DefaultedRegistryValue
- All Known Subinterfaces:
StringDataFormat
Represents a parser for a particular file format allowing reading and writing
a DataContainer to/from a stream of the specific format.
-
Method Summary
Modifier and TypeMethodDescriptionreadFrom
(InputStream input) Creates a newDataContainer
from the contents of the givenInputStream
.void
writeTo
(OutputStream output, DataView data) Methods inherited from interface org.spongepowered.api.registry.DefaultedRegistryValue
asDefaultedReference, findKey, key
-
Method Details
-
readFrom
Creates a newDataContainer
from the contents of the givenInputStream
.- Parameters:
input
- The input stream- Returns:
- A data container representing the contents of the input stream
- Throws:
InvalidDataFormatException
- If the data in the stream was not a supported formatIOException
- If there was an error reading from the stream
-
writeTo
- Parameters:
output
- The output stream to write the data todata
- The DataView to write to the stream- Throws:
IOException
- If there was an error writing to the stream
-