Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
Buffer is a simple buffer for bytes. Only one of Read or Write methods should be used for the same buffer.
func (*Buffer) Read ¶
Read reads up to len(p) bytes from buffer into p. If auto is true and the buffer does not have enough bytes to read, it will read available bytes and return the number of bytes read. If auto is false and the buffer does not have enough bytes to read, it will read available bytes and return the number of bytes read and error. If there is enough bytes to read, it will read len(p) bytes and return the number of bytes read.
func (*Buffer) Write ¶
Write writes up to len(p) bytes from p to buffer. If auto is true and the buffer does not have enough space to write, it will resize the buffer and write p to buffer. If auto is false and the buffer does not have enough space to write, it will write available space and return the number of bytes written and error. If there is enough space to write, it will write len(p) bytes and return the number of bytes written.