Documentation
¶
Index ¶
- func BidirectionalCopy(conn1, conn2 io.ReadWriteCloser)
- func ReadByte(r io.Reader) (byte, error)
- func ReadCString(r io.Reader) (str string, err error)
- func ReadN(r io.Reader, n int) (bs []byte, err error)
- func ReadPascalString(r io.Reader) (str string, err error)
- func WriteCString(w io.Writer, str string) (err error)
- func WritePascalString(w io.Writer, str string) (err error)
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
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
ReadCString reads bytes from Reader util '\0'. It returns string without '\0'
func ReadN ¶ added in v0.1.0
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
ReadPascalString reads one byte N as size and N bytes from Reader.
func WriteCString ¶ added in v0.2.0
WriteCString writes bytes to Writer and append a '\0'.
Types ¶
This section is empty.