Documentation ¶
Index ¶
- Constants
- func NewCompressReader(r io.Reader) io.Reader
- func NewCompressWriter(w io.Writer, method byte) io.Writer
- type CompressMethod
- type CorruptedDataErr
- type Reader
- func (r *Reader) ByteString() ([]byte, error)
- func (r *Reader) FixedString(strlen int) ([]byte, error)
- func (r *Reader) Int32() (int32, error)
- func (r *Reader) Read(buf []byte) (int, error)
- func (r *Reader) ReadByte() (byte, error)
- func (r *Reader) SetCompress(c bool)
- func (r *Reader) String() (string, error)
- func (r *Reader) Uint32() (uint32, error)
- func (r *Reader) Uint64() (uint64, error)
- func (r *Reader) Uvarint() (uint64, error)
- type Writer
- func (w *Writer) ByteString(v []byte)
- func (w *Writer) Int32(v int32)
- func (w *Writer) Int64(v int64)
- func (w *Writer) Output() *bytes.Buffer
- func (w *Writer) Reset()
- func (w *Writer) String(v string)
- func (w *Writer) Uint32(v uint32)
- func (w *Writer) Uint64(v uint64)
- func (w *Writer) Uint8(v uint8)
- func (w *Writer) Uvarint(v uint64)
- func (w *Writer) Write(b []byte)
- func (w *Writer) WriteTo(wt io.Writer) (int64, error)
Constants ¶
View Source
const ( // ChecksumSize is 128bits for cityhash102 checksum ChecksumSize = 16 // CompressHeaderSize magic + compressed_size + uncompressed_size CompressHeaderSize = 1 + 4 + 4 // HeaderSize for compress header HeaderSize = ChecksumSize + CompressHeaderSize // BlockMaxSize 1MB BlockMaxSize = 1024 * 1024 * 128 )
Variables ¶
This section is empty.
Functions ¶
func NewCompressReader ¶
NewCompressReader wrap the io.Reader
Types ¶
type CompressMethod ¶
type CompressMethod byte
Method is compression codec.
const ( CompressNone CompressMethod = 0x00 CompressChecksum CompressMethod = 0x02 CompressLZ4 CompressMethod = 0x82 CompressZSTD CompressMethod = 0x90 )
Possible compression methods.
type CorruptedDataErr ¶
CorruptedDataErr means that provided hash mismatch with calculated.
func (*CorruptedDataErr) Error ¶
func (c *CorruptedDataErr) Error() string
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader is a helper to read data from reader
func (*Reader) ByteString ¶
ByteString read string value as []byte
func (*Reader) FixedString ¶
FixedString read FixedString value
Click to show internal directories.
Click to hide internal directories.