reader

package
v0.12.4 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2023 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ErrEncodingIsNotCertain = "encoding is not certain: %v"
	ErrDataIsBuffered       = "data is buffered"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

Reader is a reader capable of guessing the encoding of a stream. The reader is single-threaded, i.e. it does not support concurrency.

func NewReader

func NewReader(r io.Reader, shouldSkipBOM bool) (bomReader *Reader, err error)

func (*Reader) Close added in v0.9.2

func (br *Reader) Close() (err error)

Close closes the reader. It is a standard method for the 'io.Closer' interface.

func (*Reader) GetEncodings

func (br *Reader) GetEncodings() (encodings []bom.Encoding)

GetEncodings returns the list of encodings detected in the data stream.

func (*Reader) Read

func (br *Reader) Read(dst []byte) (n int, err error)

Read reads data from the stream. It is a standard method for the 'io.Reader' interface.

Jump to

Keyboard shortcuts

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