Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ByteArrayToString ¶
ByteArrayToString turns a slice of bytes to string, without extra memory allocations
NOTE! Using this function is extremely dangerous, so it can be done with extra care with clear understanding how it works
func StringToByteArray ¶
StringToByteArray gets a string and turn it to []byte without extra memoy allocations
NOTE! Using this function is extremely dangerous, so it can be done with extra care with clear understanding how it works
Types ¶
type Pool ¶
type Pool struct { }
Pool manages a pool of slices of bytes. It is supposed to use the pool in highly loaded apps where slice of bytes are needed often. An example could be handling a network packages.
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer struct support io.Writer interface and allows to write data into extendable underlying buffer. It uses Pool for arranging new buffers.
The Writer MUST not be copied.
func (*Writer) Init ¶
Init initilizes the Writer to use Pool p and initialize the w.buf to specified size
func (*Writer) Reset ¶
func (w *Writer) Reset()
Reset drops the pos to 0, but it doesn't touch underlying buffer
func (*Writer) WriteString ¶
WriteString writes string to the buffer