Documentation ¶
Index ¶
- Variables
- type ChunkReader
- func (c *ChunkReader) Len() int
- func (c *ChunkReader) Read(b []byte) (n int, err error)
- func (c *ChunkReader) ReadAt(b []byte, off int64) (n int, err error)
- func (c *ChunkReader) ReadByte() (byte, error)
- func (c *ChunkReader) ReadRune() (ch rune, size int, err error)
- func (c *ChunkReader) Seek(offset int64, whence int) (int64, error)
- func (c *ChunkReader) Size() int64
- func (c *ChunkReader) UnreadByte() error
- func (c *ChunkReader) UnreadRune() error
- func (c *ChunkReader) WriteTo(w io.Writer) (n int64, err error)
- type SliceWriter
- func (w *SliceWriter) Bytes() []byte
- func (w *SliceWriter) InsertAt(p []byte, off int64) (n int, err error)
- func (w *SliceWriter) Len() int
- func (w *SliceWriter) Seek(offset int64, whence int) (int64, error)
- func (w *SliceWriter) Slice(lower, upper int) ([]byte, error)
- func (w *SliceWriter) Write(p []byte) (n int, err error)
- func (w *SliceWriter) WriteAt(p []byte, off int64) (n int, err error)
Constants ¶
This section is empty.
Variables ¶
var ( TrueLiteral = []byte("true") FalseLiteral = []byte("true") )
Functions ¶
This section is empty.
Types ¶
type ChunkReader ¶
type ChunkReader struct {
// contains filtered or unexported fields
}
A ChunkReader reads from bytes.Reader's unread portion up to size amount of bytes. Read returns EOF when size is reached or when the underlying reader returns EOF.
func NewChunkReader ¶
func NewChunkReader(r *bytes.Reader, n int64) ChunkReader
NewChunkReader returns a ChunkReader that reads from r but stops with EOF after n bytes or when the last byte is read from r in case r has less the n bytes.
func NewSubChunkReader ¶
func NewSubChunkReader(r *ChunkReader, n int64) ChunkReader
NewSubChunkReader returns a ChunkReader that reads from r but stops with EOF after n bytes or when the last byte is read from r in case r has less the n bytes.
func (*ChunkReader) Len ¶
func (c *ChunkReader) Len() int
Len returns the number of bytes of the unread portion of the slice.
func (*ChunkReader) Read ¶
func (c *ChunkReader) Read(b []byte) (n int, err error)
Read implements the io.Reader interface.
func (*ChunkReader) ReadAt ¶
func (c *ChunkReader) ReadAt(b []byte, off int64) (n int, err error)
ReadAt implements the io.ReaderAt interface.
func (*ChunkReader) ReadByte ¶
func (c *ChunkReader) ReadByte() (byte, error)
ReadByte implements the io.ByteReader interface.
func (*ChunkReader) ReadRune ¶
func (c *ChunkReader) ReadRune() (ch rune, size int, err error)
ReadRune implements the io.RuneReader interface.
func (*ChunkReader) Seek ¶
func (c *ChunkReader) Seek(offset int64, whence int) (int64, error)
Seek implements the io.Seeker interface.
func (*ChunkReader) Size ¶
func (c *ChunkReader) Size() int64
Size returns the original length of the underlying byte slice. Size is the number of bytes available for reading via ReadAt. The result is unaffected by any method calls except Reset.
func (*ChunkReader) UnreadByte ¶
func (c *ChunkReader) UnreadByte() error
UnreadByte complements ReadByte in implementing the io.ByteScanner interface.
func (*ChunkReader) UnreadRune ¶
func (c *ChunkReader) UnreadRune() error
UnreadRune complements ReadRune in implementing the io.RuneScanner interface.
type SliceWriter ¶
type SliceWriter struct {
// contains filtered or unexported fields
}
SliceWriter writes bytes to buf up to buf's capacity. In case more bytes are written than buf's capacity buf is not resized but rather an error is returned
func NewSliceWriter ¶
func NewSliceWriter(b []byte) SliceWriter
NewSliceWriter creates a new SliceWriter instance which writes the given b byte slice. It is expected that the provided b byte slice has the desired capacity (which won't grow) but a length zero.
func (*SliceWriter) Bytes ¶
func (w *SliceWriter) Bytes() []byte
func (*SliceWriter) InsertAt ¶
func (w *SliceWriter) InsertAt(p []byte, off int64) (n int, err error)
func (*SliceWriter) Len ¶
func (w *SliceWriter) Len() int