io

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BidirectionalCopy

func BidirectionalCopy(conn1, conn2 io.ReadWriteCloser)

Bind establishes a bidirectional data transfer between two connections. Two connections will be closed if anyone is closed.

func ReadByte added in v0.1.0

func ReadByte(r io.Reader) (byte, error)

ReadByte reads and returns the next byte from the Reader or any error encountered. If ReadByte returns an error, no input byte was consumed, and the returned byte value is undefined.

func ReadCString added in v0.1.0

func ReadCString(r io.Reader) (str string, err error)

ReadCString reads bytes from Reader util '\0'. It returns string without '\0'

func ReadN added in v0.1.0

func ReadN(r io.Reader, n int) (bs []byte, err error)

ReadN reads and returns the next N bytes from the Reader or any error encountered. It returns bytes copied and an error if fewer bytes were read. The error is EOF only if no bytes were read. If an EOF happens after reading some but not all the bytes, ReadN returns ErrUnexpectedEOF.

func ReadPascalString added in v0.1.0

func ReadPascalString(r io.Reader) (str string, err error)

ReadPascalString reads one byte N as size and N bytes from Reader.

func WriteCString added in v0.2.0

func WriteCString(w io.Writer, str string) (err error)

WriteCString writes bytes to Writer and append a '\0'.

func WritePascalString added in v0.2.0

func WritePascalString(w io.Writer, str string) (err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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