Interface DataFormat
- 
- All Superinterfaces:
- DefaultedRegistryValue
 - All Known Subinterfaces:
- StringDataFormat
 
 @CatalogedBy(DataFormats.class) public interface DataFormat extends DefaultedRegistryValue Represents a parser for a particular file format allowing reading and writing a DataContainer to/from a stream of the specific format.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description DataContainerreadFrom(java.io.InputStream input)Creates a newDataContainerfrom the contents of the givenInputStream.voidwriteTo(java.io.OutputStream output, DataView data)- 
Methods inherited from interface org.spongepowered.api.registry.DefaultedRegistryValueasDefaultedReference, findKey, key
 
- 
 
- 
- 
- 
Method Detail- 
readFromDataContainer readFrom(java.io.InputStream input) throws InvalidDataFormatException, java.io.IOException Creates a newDataContainerfrom 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 format
- java.io.IOException- If there was an error reading from the stream
 
 - 
writeTovoid writeTo(java.io.OutputStream output, DataView data) throws java.io.IOException- Parameters:
- output- The output stream to write the data to
- data- The DataView to write to the stream
- Throws:
- java.io.IOException- If there was an error writing to the stream
 
 
- 
 
-