Package com.e1c.g5.v8.fastzip.entry
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Maximal entry descriptor length. -
Method Summary
Modifier and TypeMethodDescriptionreadEntryDescriptor
(Supplier<DataInput> inputSupplier) Deserializes entry fromDataInput
.void
writeEntryDescriptor
(IFzipEntry entry, DataOutput out) Serializes an entry toDataOutput
.
-
Field Details
-
MAX_ENTRY_DESCRIPTOR_LENGTH
static final int MAX_ENTRY_DESCRIPTOR_LENGTHMaximal entry descriptor length.- See Also:
-
-
Method Details
-
writeEntryDescriptor
Serializes an entry toDataOutput
.The behaviour is unspecified if more than
MAX_ENTRY_DESCRIPTOR_LENGTH
bytes were written to the output.- Parameters:
entry
- the entry, nevernull
out
- the output, nevernull
- Throws:
IOException
- if an IO error occurs
-
readEntryDescriptor
Deserializes entry fromDataInput
.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, nevernull
- Returns:
- the deserialized entry, cannot be
null
- Throws:
IOException
- if an IO error occurs or the entry cannot be deserialized
-