bufio

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2019 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 {
	// 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) Cnt added in v0.12.1

func (r *Reader) Cnt() int

Cnt returns the value of the byte read counter.

func (*Reader) GetError added in v0.10.0

func (r *Reader) GetError() error

GetError returns reader error.

func (*Reader) ReadB added in v0.11.2

func (r *Reader) ReadB() byte

ReadB reads and returns a byte.

func (*Reader) ReadBool

func (r *Reader) ReadBool() bool

ReadBool reads and returns a boolean.

func (*Reader) ReadCesu8

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

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

func (*Reader) ReadFloat32

func (r *Reader) ReadFloat32() float32

ReadFloat32 reads and returns a float32.

func (*Reader) ReadFloat64

func (r *Reader) ReadFloat64() float64

ReadFloat64 reads and returns a float64.

func (*Reader) ReadFull

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

ReadFull implements io.ReadFull on Reader.

func (*Reader) ReadInt16

func (r *Reader) ReadInt16() int16

ReadInt16 reads and returns an int16.

func (*Reader) ReadInt32

func (r *Reader) ReadInt32() int32

ReadInt32 reads and returns an int32.

func (*Reader) ReadInt64

func (r *Reader) ReadInt64() int64

ReadInt64 reads and returns an int64.

func (*Reader) ReadInt8

func (r *Reader) ReadInt8() int8

ReadInt8 reads and returns an int8.

func (*Reader) ReadUint16

func (r *Reader) ReadUint16() uint16

ReadUint16 reads and returns an uint16.

func (*Reader) ReadUint32

func (r *Reader) ReadUint32() uint32

ReadUint32 reads and returns an uint32.

func (*Reader) ReadUint64

func (r *Reader) ReadUint64() uint64

ReadUint64 reads and returns an uint64.

func (*Reader) ResetCnt added in v0.12.1

func (r *Reader) ResetCnt()

ResetCnt resets the byte read counter.

func (*Reader) Skip

func (r *Reader) Skip(cnt int)

Skip skips cnt bytes from reading.

type Writer

type Writer struct {
	// 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) Flush added in v0.10.0

func (w *Writer) Flush() error

Flush writes any buffered data to the underlying io.Writer.

func (*Writer) Write added in v0.10.0

func (w *Writer) Write(p []byte)

Write writes the contents of p.

func (*Writer) WriteB added in v0.11.2

func (w *Writer) WriteB(b byte)

WriteB writes a byte.

func (*Writer) WriteBool

func (w *Writer) WriteBool(v bool)

WriteBool writes a boolean.

func (*Writer) WriteCesu8

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

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)

WriteFloat32 writes a float32.

func (*Writer) WriteFloat64

func (w *Writer) WriteFloat64(f float64)

WriteFloat64 writes a float64.

func (*Writer) WriteInt16

func (w *Writer) WriteInt16(i int16)

WriteInt16 writes an int16.

func (*Writer) WriteInt32

func (w *Writer) WriteInt32(i int32)

WriteInt32 writes an int32.

func (*Writer) WriteInt64

func (w *Writer) WriteInt64(i int64)

WriteInt64 writes an int64.

func (*Writer) WriteInt8

func (w *Writer) WriteInt8(i int8)

WriteInt8 writes an int8.

func (*Writer) WriteString added in v0.10.0

func (w *Writer) WriteString(s string)

WriteString writes a string.

func (*Writer) WriteStringCesu8

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

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

func (*Writer) WriteUint16

func (w *Writer) WriteUint16(i uint16)

WriteUint16 writes an uint16.

func (*Writer) WriteUint32

func (w *Writer) WriteUint32(i uint32)

WriteUint32 writes an uint32.

func (*Writer) WriteUint64

func (w *Writer) WriteUint64(i uint64)

WriteUint64 writes an uint64.

func (*Writer) WriteZeroes

func (w *Writer) WriteZeroes(cnt int)

WriteZeroes writes cnt zero byte values.

Jump to

Keyboard shortcuts

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