Interface ChunkIoService

All Known Implementing Classes:
AnvilChunkIoService

public interface ChunkIoService
Provider of chunk I/O services.

Implemented by classes to provide a way of saving and loading chunks to external storage.

  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    read​(GlowChunk chunk)
    Reads a single chunk.
    void
    Unload the service, performing any cleanup necessary.
    void
    write​(GlowChunk chunk)
    Writes a single chunk.
  • Method Details

    • read

      boolean read(GlowChunk chunk) throws IOException
      Reads a single chunk. The provided chunk must not yet be initialized.
      Parameters:
      chunk - The GlowChunk to read into.
      Returns:
      if the read was successful.
      Throws:
      IOException - if an I/O error occurs.
    • write

      void write(GlowChunk chunk) throws IOException
      Writes a single chunk.
      Parameters:
      chunk - The GlowChunk to write from.
      Throws:
      IOException - if an I/O error occurs.
    • unload

      void unload() throws IOException
      Unload the service, performing any cleanup necessary.
      Throws:
      IOException - if an I/O error occurs.