Documentation ¶
Index ¶
- type DataType
- type HashWriter
- type Reader
- func (r *Reader) DecompressToFile(filePath string) error
- func (r *Reader) Read(expectedType DataType) (interface{}, DataType, error)
- func (r *Reader) ReadCompressedBlock(out []byte) (err error)
- func (r *Reader) ReadGivenType(givenType DataType) (interface{}, DataType, error)
- func (r *Reader) ReadRaw(out []byte) (n int, err error)
- type Writer
- func (w *Writer) Close() error
- func (w *Writer) Offset() uint64
- func (w *Writer) SeekOffset(offset uint64) error
- func (w *Writer) SetExcludeWriteType(b bool)
- func (w *Writer) Write(data interface{}) (offset uint64, length int, err error)
- func (w *Writer) WriteRaw(buf []byte) (offset uint64, err error)
- func (w *Writer) WriteRawByte(b byte) (offset uint64, err error)
- func (w *Writer) WriteRawToLZ4Compress(buf []byte) (offset uint64, length int, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HashWriter ¶
type HashWriter struct {
// contains filtered or unexported fields
}
func NewHashWriter ¶
func NewHashWriter(w io.Writer) *HashWriter
NewHashWriter returns a new HashWriter which wraps the provided writer.
func (*HashWriter) CRC32 ¶
func (h *HashWriter) CRC32() uint32
CRC32 will return the CRC-32 hash of the written content.
func (*HashWriter) Count ¶
func (h *HashWriter) Count() uint64
Count returns the number of bytes written.
func (*HashWriter) Write ¶
func (h *HashWriter) Write(p []byte) (n int, err error)
Write writes the provided bytes to the wrapped writer, recalculates the checksum and counts the bytes.
func (*HashWriter) WriteByte ¶
func (h *HashWriter) WriteByte(b byte) (err error)
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
func NewReader ¶
func NewReader(r io.ReadSeeker) *Reader
func NewReaderFromBuffer ¶
func (*Reader) DecompressToFile ¶
DecompressToFile will read in the entire reader buffer and decompress it to the specified file.
func (*Reader) ReadCompressedBlock ¶
ReadCompressedBlock will read the next block and decompress it into out.
func (*Reader) ReadGivenType ¶
ReadGivenType will read the next value given the type.
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
func NewWriterFromBuffer ¶
NewBufferFromBuffer will return a new writer from a specified byte buffer.
func (*Writer) SeekOffset ¶
func (*Writer) SetExcludeWriteType ¶
SetExcludeWriteType will toggle whether data type enums are written to the buffer.
func (*Writer) WriteRawByte ¶
WriteRawByte will write a single byte into the writer.