Package com.e1c.g5.v8.fastzip
Class StaticEntryRegistry
- java.lang.Object
-
- com.e1c.g5.v8.fastzip.StaticEntryRegistry
-
- All Implemented Interfaces:
IFzipEntryRegistry
public class StaticEntryRegistry extends Object implements IFzipEntryRegistry
Testing entry registry which manages a fixed set of FastZIP entries.
-
-
Field Summary
-
Fields inherited from interface com.e1c.g5.v8.fastzip.entry.IFzipEntryRegistry
MAX_ENTRY_DESCRIPTOR_LENGTH
-
-
Constructor Summary
Constructors Constructor Description StaticEntryRegistry(Collection<IFzipEntry> entries)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IFzipEntry[]getEntries()IFzipEntryreadEntryDescriptor(Supplier<DataInput> inputSupplier)Deserializes entry fromDataInput.voidwriteEntryDescriptor(IFzipEntry entry, DataOutput out)Serializes an entry toDataOutput.
-
-
-
Constructor Detail
-
StaticEntryRegistry
public StaticEntryRegistry(Collection<IFzipEntry> entries)
-
-
Method Detail
-
getEntries
public IFzipEntry[] getEntries()
-
writeEntryDescriptor
public void writeEntryDescriptor(IFzipEntry entry, DataOutput out) throws IOException
Description copied from interface:IFzipEntryRegistrySerializes an entry toDataOutput.The behaviour is unspecified if more than
IFzipEntryRegistry.MAX_ENTRY_DESCRIPTOR_LENGTHbytes were written to the output.- Specified by:
writeEntryDescriptorin interfaceIFzipEntryRegistry- Parameters:
entry- the entry, nevernullout- the output, nevernull- Throws:
IOException- if an IO error occurs
-
readEntryDescriptor
public IFzipEntry readEntryDescriptor(Supplier<DataInput> inputSupplier) throws IOException
Description copied from interface:IFzipEntryRegistryDeserializes 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
IFzipEntryRegistry.MAX_ENTRY_DESCRIPTOR_LENGTHbytes were read from the input.- Specified by:
readEntryDescriptorin interfaceIFzipEntryRegistry- 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
-
-