Class BinaryFormat
java.lang.Object
dev.siroshun.configapi.format.binary.BinaryFormat
- All Implemented Interfaces:
FileFormat<Node<?>>
A
FileFormat implementation that loading/saving MapNode from/to binary format.
Supported Nodes:
ValueNodes excludingEnumValueArrayNode,ListNodeandMapNodeNullNodeCommentedNode- The comment will be dropped
For specifications of this format, please see the comments in the source code.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescription@NotNull Node<?>load(@NotNull InputStream input) Loads a node from aInputStream.@NotNull Node<?>Deprecated.Not supported@NotNull Node<?>Loads a node from a file.voidsave(@NotNull Node<?> node, @NotNull OutputStream output) Saves a node to aOutputStream.voidDeprecated.Not supportedvoidSaves a node to a file.
-
Field Details
-
DEFAULT
An instance ofBinaryFormat.
-
-
Method Details
-
load
Description copied from interface:FileFormatLoads a node from a file.- Specified by:
loadin interfaceFileFormat<Node<?>>- Parameters:
filepath- a filepath to load a node- Returns:
- a loaded
Node(FileFormat) - Throws:
IOException- if I/O error occurred
-
load
Description copied from interface:FileFormatLoads a node from aInputStream.- Specified by:
loadin interfaceFileFormat<Node<?>>- Parameters:
input- aInputStreamto load a node- Returns:
- a loaded
Node(FileFormat) - Throws:
IOException- if I/O error occurred
-
save
public void save(@NotNull @NotNull Node<?> node, @NotNull @NotNull Path filepath) throws IOException Description copied from interface:FileFormatSaves a node to a file.- Specified by:
savein interfaceFileFormat<Node<?>>- Parameters:
node- a rootNode(FileFormat) to savefilepath- a filepath to write a node- Throws:
IOException- if I/O error occurred
-
save
public void save(@NotNull @NotNull Node<?> node, @NotNull @NotNull OutputStream output) throws IOException Description copied from interface:FileFormatSaves a node to aOutputStream.- Specified by:
savein interfaceFileFormat<Node<?>>- Parameters:
node- a rootNode(FileFormat) to saveoutput- aOutputStreamto write a node- Throws:
IOException- if I/O error occurred
-
load
Deprecated.Not supportedLoads a node from aReader.- Specified by:
loadin interfaceFileFormat<Node<?>>- Parameters:
reader- aReaderto load a node- Returns:
- a loaded
Node(FileFormat)
-
save
Deprecated.Not supportedSaves a node to aWriter.- Specified by:
savein interfaceFileFormat<Node<?>>- Parameters:
node- a rootNode(FileFormat) to savewriter- aWriterto write a node
-