Package com.e1c.g5.v8.fastzip.entry
Interface IFzipEntryRegistry
-
- All Known Implementing Classes:
FsFzipEntryRegistry
,FzipIoTest.MultiReadEntryRegistry
,StaticEntryRegistry
public interface IFzipEntryRegistry
FastZIP entry registry. Implementations are responsible for creating, serializing and deserializing ofFastZIP entries
.Implementations are encouraged to keep entry descriptors as small as possible. All heavy data must be written and restored by the entry
write
andread
methods respectively.
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_ENTRY_DESCRIPTOR_LENGTH
Maximal entry descriptor length.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IFzipEntry
readEntryDescriptor(Supplier<DataInput> inputSupplier)
Deserializes entry fromDataInput
.void
writeEntryDescriptor(IFzipEntry entry, DataOutput out)
Serializes an entry toDataOutput
.
-
-
-
Field Detail
-
MAX_ENTRY_DESCRIPTOR_LENGTH
static final int MAX_ENTRY_DESCRIPTOR_LENGTH
Maximal entry descriptor length.- See Also:
- Constant Field Values
-
-
Method Detail
-
writeEntryDescriptor
void writeEntryDescriptor(IFzipEntry entry, DataOutput out) throws IOException
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
IFzipEntry readEntryDescriptor(Supplier<DataInput> inputSupplier) throws IOException
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
-
-