CodecUtil
Utility class for reading and writing versioned headers.
Writing codec headers is useful to ensure that a file is in the format you think it is.
Properties
Functions
Validates the codec footer previously written by .writeFooter.
Validates the codec footer previously written by .writeFooter, optionally passing an unexpected exception that has already occurred.
Expert: just reads and verifies the object ID of an index header
Expert: just reads and verifies the suffix of an index header
Clones the provided input, reads all bytes from the file, and calls .checkFooter
Computes the length of a codec footer.
Computes the length of a codec header.
Computes the length of an index header.
read long value from header / footer with big endian order
Reads CRC32 value as a 64-bit long from the input.
Retrieves the full footer from the provided IndexInput. This throws [ ] if this file does not have a valid footer.
Retrieves the full index header from the provided IndexInput. This throws [ ] if this file does not appear to be an index file.
Returns (but does not validate) the checksum previously written by .checkFooter.
Expert: verifies the incoming IndexInput has an index header and that its segment ID matches the expected one, and then copies that index header into the provided [ ]. This is useful when building compound files.
write int value on header / footer with big endian order
write long value on header / footer with big endian order
Writes CRC32 value as a 64-bit long to the output.
Writes a codec footer, which records both a checksum algorithm ID and a checksum. This footer can be parsed and validated with .checkFooter.
Writes a codec header, which records both a string to identify the file and a version number. This header can be parsed and validated with .checkHeader.
Writes a codec header for an index file, which records both a string to identify the format of the file, a version number, and data to identify the file instance (ID and auxiliary suffix such as generation).