Class Dump.Builder

java.lang.Object
dev.hloth.zgztransport.Dump.Builder
Enclosing class:
Dump

public static final class Dump.Builder extends Object
Fills the blocks of a dump one at a time, leaving the untouched ones zeroed.
  • Method Details

    • block

      public Dump.Builder block(int index, Encodable content)
      Writes a structure into a block.
      Parameters:
      index - the block number
      content - the structure, which has to encode to a whole block
      Returns:
      this builder
      Throws:
      CardFormatException - if the block is outside the dump or the structure is not sixteen bytes long
    • block

      public Dump.Builder block(int index, byte[] content)
      Writes raw bytes into a block.
      Parameters:
      index - the block number
      content - the sixteen bytes
      Returns:
      this builder
      Throws:
      CardFormatException - if the block is outside the dump or the bytes are not sixteen long
    • build

      public Dump build()
      Builds the dump.
      Returns:
      the dump