Class BinaryFormat

java.lang.Object
dev.siroshun.configapi.format.binary.BinaryFormat
All Implemented Interfaces:
dev.siroshun.configapi.core.file.FileFormat<dev.siroshun.configapi.core.node.Node<?>>

public final class BinaryFormat extends Object implements dev.siroshun.configapi.core.file.FileFormat<dev.siroshun.configapi.core.node.Node<?>>
A FileFormat implementation that loading/saving MapNode from/to binary format.

Supported Nodes:

  • ValueNodes excluding EnumValue
  • ArrayNode, ListNode and MapNode
  • NullNode
  • CommentedNode - The comment will be dropped

For specifications of this format, please see the comments in the source code.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final BinaryFormat
    An instance of BinaryFormat.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull dev.siroshun.configapi.core.node.Node<?>
    load(@NotNull InputStream input)
     
    @NotNull dev.siroshun.configapi.core.node.Node<?>
    load(@NotNull Reader reader)
    Deprecated.
    Not supported
    @NotNull dev.siroshun.configapi.core.node.Node<?>
    load(@NotNull Path filepath)
     
    void
    save(@NotNull dev.siroshun.configapi.core.node.Node<?> node, @NotNull OutputStream output)
     
    void
    save(@NotNull dev.siroshun.configapi.core.node.Node<?> node, @NotNull Writer writer)
    Deprecated.
    Not supported
    void
    save(@NotNull dev.siroshun.configapi.core.node.Node<?> node, @NotNull Path filepath)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Method Details

    • load

      @NotNull public @NotNull dev.siroshun.configapi.core.node.Node<?> load(@NotNull @NotNull Path filepath) throws IOException
      Specified by:
      load in interface dev.siroshun.configapi.core.file.FileFormat<dev.siroshun.configapi.core.node.Node<?>>
      Throws:
      IOException
    • load

      @NotNull public @NotNull dev.siroshun.configapi.core.node.Node<?> load(@NotNull @NotNull InputStream input) throws IOException
      Specified by:
      load in interface dev.siroshun.configapi.core.file.FileFormat<dev.siroshun.configapi.core.node.Node<?>>
      Throws:
      IOException
    • save

      public void save(@NotNull @NotNull dev.siroshun.configapi.core.node.Node<?> node, @NotNull @NotNull Path filepath) throws IOException
      Specified by:
      save in interface dev.siroshun.configapi.core.file.FileFormat<dev.siroshun.configapi.core.node.Node<?>>
      Throws:
      IOException
    • save

      public void save(@NotNull @NotNull dev.siroshun.configapi.core.node.Node<?> node, @NotNull @NotNull OutputStream output) throws IOException
      Specified by:
      save in interface dev.siroshun.configapi.core.file.FileFormat<dev.siroshun.configapi.core.node.Node<?>>
      Throws:
      IOException
    • load

      @Deprecated @NotNull public @NotNull dev.siroshun.configapi.core.node.Node<?> load(@NotNull @NotNull Reader reader)
      Deprecated.
      Not supported
      Specified by:
      load in interface dev.siroshun.configapi.core.file.FileFormat<dev.siroshun.configapi.core.node.Node<?>>
    • save

      @Deprecated public void save(@NotNull @NotNull dev.siroshun.configapi.core.node.Node<?> node, @NotNull @NotNull Writer writer)
      Deprecated.
      Not supported
      Specified by:
      save in interface dev.siroshun.configapi.core.file.FileFormat<dev.siroshun.configapi.core.node.Node<?>>