Class StructureSerializationServiceImpl

java.lang.Object
com.github.shynixn.structureblocklib.bukkit.v1_17_R1.StructureSerializationServiceImpl
All Implemented Interfaces:
com.github.shynixn.structureblocklib.api.service.StructureSerializationService

public class StructureSerializationServiceImpl extends Object implements com.github.shynixn.structureblocklib.api.service.StructureSerializationService
Serialization service.
  • Constructor Details

    • StructureSerializationServiceImpl

      public StructureSerializationServiceImpl()
  • Method Details

    • deSerialize

      public Object deSerialize(InputStream inputStream) throws IOException
      Deserializes the InputStream to an NMS handle of StructureTemplate. This call is blocking.
      Specified by:
      deSerialize in interface com.github.shynixn.structureblocklib.api.service.StructureSerializationService
      Parameters:
      inputStream - Opened inputStream. Does not close the stream after processing.
      Returns:
      A new NMS instance of StructureTemplate.
      Throws:
      IOException
    • serialize

      public void serialize(Object structureTemplate, OutputStream outputStream) throws IOException
      Serializes the NMS handle of StructureTemplate to an OutputStream. This call is blocking.
      Specified by:
      serialize in interface com.github.shynixn.structureblocklib.api.service.StructureSerializationService
      Parameters:
      structureTemplate - NMS handle.
      outputStream - Opened outputStream. Does not close the stream after processing.
      Throws:
      IOException