Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader implements an io.ReadAt, reading from the input source after verifying the checksum.
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer implements an io.WriteCloser, it calculates and stores a CRC-32 checksum for the payload before writing to the underlying object.
For example, a layout of the checksum block which payload is 2100 bytes is as follow:
| -- 4B -- | -- 1020B -- || -- 4B -- | -- 1020B -- || -- 4B -- | -- 60B -- | | -- checksum -- | -- payload -- || -- checksum -- | -- payload -- || -- checksum -- | -- payload -- |
func NewWriter ¶
func NewWriter(w io.WriteCloser) *Writer
NewWriter returns a new Writer which calculates and stores a CRC-32 checksum for the payload before writing to the underlying object.
func (*Writer) AvailableSize ¶
AvailableSize returns how many bytes are unused in the buffer.
func (*Writer) Buffered ¶
Buffered returns the number of bytes that have been written into the current buffer.
func (*Writer) GetCacheDataOffset ¶
GetCacheDataOffset return the user data offset in cache.