Interface IFzipEntryRegistry

All Known Implementing Classes:
FsFzipEntryRegistry, FzipIoTest.MultiReadEntryRegistry, SnapshotEntryRegistry, StaticEntryRegistry

public interface IFzipEntryRegistry
FastZIP entry registry. Implementations are responsible for creating, serializing and deserializing of FastZIP entries.

Implementations are encouraged to keep entry descriptors as small as possible. All heavy data must be written and restored by the entry write and read methods respectively.

  • Field Details

    • MAX_ENTRY_DESCRIPTOR_LENGTH

      static final int MAX_ENTRY_DESCRIPTOR_LENGTH
      Maximal entry descriptor length.
      See Also:
  • Method Details

    • writeEntryDescriptor

      void writeEntryDescriptor(IFzipEntry entry, DataOutput out) throws IOException
      Serializes an entry to DataOutput.

      The behaviour is unspecified if more than MAX_ENTRY_DESCRIPTOR_LENGTH bytes were written to the output.

      Parameters:
      entry - the entry, never null
      out - the output, never null
      Throws:
      IOException - if an IO error occurs
    • readEntryDescriptor

      IFzipEntry readEntryDescriptor(Supplier<DataInput> inputSupplier) throws IOException
      Deserializes entry from DataInput.

      The input is provided by a supplier. The supplier may be invoked multiple times. Each invocation will yield an input with the same data.

      The number of bytes read from the last supplied input must be equal to the number of bytes written on serialization. Otherwise the behaviour is unspecified.

      The behaviour is unspecified if more than MAX_ENTRY_DESCRIPTOR_LENGTH bytes were read from the input.

      Parameters:
      inputSupplier - the input supplier, never null
      Returns:
      the deserialized entry, cannot be null
      Throws:
      IOException - if an IO error occurs or the entry cannot be deserialized