bufio

package
v0.8.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 3, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package bufio implements buffered I/O for database read and writes on basis of the standard Go bufio package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

type Reader struct {
	*bufio.Reader
	// contains filtered or unexported fields
}

Reader is a bufio.Reader extended by methods needed for hdb protocol.

func NewReader

func NewReader(r io.Reader) *Reader

NewReader creates a new Reader instance.

func NewReaderSize

func NewReaderSize(r io.Reader, size int) *Reader

NewReaderSize creates a new Reader instance with given size for bufio.Reader.

func (*Reader) ReadBool

func (r *Reader) ReadBool() (bool, error)

ReadBool reads and returns a boolean.

func (*Reader) ReadCesu8

func (r *Reader) ReadCesu8(size int) ([]byte, error)

ReadCesu8 reads a size CESU-8 encoded byte sequence and returns an UTF-8 byte slice.

func (*Reader) ReadFloat32

func (r *Reader) ReadFloat32() (float32, error)

ReadFloat32 reads and returns a float32.

func (*Reader) ReadFloat64

func (r *Reader) ReadFloat64() (float64, error)

ReadFloat64 reads and returns a float64.

func (*Reader) ReadFull

func (r *Reader) ReadFull(p []byte) error

ReadFull implements io.ReadFull on Reader.

func (*Reader) ReadInt16

func (r *Reader) ReadInt16() (int16, error)

ReadInt16 reads and returns an int16.

func (*Reader) ReadInt32

func (r *Reader) ReadInt32() (int32, error)

ReadInt32 reads and returns an int32.

func (*Reader) ReadInt64

func (r *Reader) ReadInt64() (int64, error)

ReadInt64 reads and returns an int64.

func (*Reader) ReadInt8

func (r *Reader) ReadInt8() (int8, error)

ReadInt8 reads and returns an int8.

func (*Reader) ReadUint16

func (r *Reader) ReadUint16() (uint16, error)

ReadUint16 reads and returns an uint16.

func (*Reader) ReadUint32

func (r *Reader) ReadUint32() (uint32, error)

ReadUint32 reads and returns an uint32.

func (*Reader) ReadUint64

func (r *Reader) ReadUint64() (uint64, error)

ReadUint64 reads and returns an uint64.

func (*Reader) Skip

func (r *Reader) Skip(cnt int) error

Skip skips cnt bytes from reading.

type Writer

type Writer struct {
	*bufio.Writer
	// contains filtered or unexported fields
}

Writer is a bufio.Writer extended by methods needed for hdb protocol.

func NewWriter

func NewWriter(w io.Writer) *Writer

NewWriter creates a new Writer instance.

func NewWriterSize

func NewWriterSize(w io.Writer, size int) *Writer

NewWriterSize creates a new Writer instance with given size for bufio.Writer.

func (*Writer) WriteBool

func (w *Writer) WriteBool(v bool) error

WriteBool writes a boolean.

func (*Writer) WriteCesu8

func (w *Writer) WriteCesu8(p []byte) (int, error)

WriteCesu8 writes an UTF-8 byte slice as CESU-8 and returns the CESU-8 bytes written.

func (*Writer) WriteFloat32

func (w *Writer) WriteFloat32(f float32) error

WriteFloat32 writes a float32.

func (*Writer) WriteFloat64

func (w *Writer) WriteFloat64(f float64) error

WriteFloat64 writes a float64.

func (*Writer) WriteInt16

func (w *Writer) WriteInt16(i int16) error

WriteInt16 writes an int16.

func (*Writer) WriteInt32

func (w *Writer) WriteInt32(i int32) error

WriteInt32 writes an int32.

func (*Writer) WriteInt64

func (w *Writer) WriteInt64(i int64) error

WriteInt64 writes an int64.

func (*Writer) WriteInt8

func (w *Writer) WriteInt8(i int8) error

WriteInt8 writes an int8.

func (*Writer) WriteStringCesu8

func (w *Writer) WriteStringCesu8(s string) (int, error)

WriteStringCesu8 is like WriteCesu8 with an UTF-8 string as parameter.

func (*Writer) WriteUint16

func (w *Writer) WriteUint16(i uint16) error

WriteUint16 writes an uint16.

func (*Writer) WriteUint32

func (w *Writer) WriteUint32(i uint32) error

WriteUint32 writes an uint32.

func (*Writer) WriteUint64

func (w *Writer) WriteUint64(i uint64) error

WriteUint64 writes an uint64.

func (*Writer) WriteZeroes

func (w *Writer) WriteZeroes(cnt int) error

WriteZeroes writes cnt zero byte values.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL