Go Package bytes: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 5: Line 5:
=Internal=
=Internal=


* [[Go Concepts - Standard Library#Packages|Go Standard Library]]
* [[Go Concepts - Standard Library#Packages|Standard Library]]


=<tt>Buffer</tt>=
=<tt>Buffer</tt>=

Revision as of 22:45, 30 March 2016

External

Internal

Buffer

A Buffer is a variable-sized buffer of bytes with Read and Write methods. The zero value for Buffer is an empty buffer ready to use. A Buffer does not have to be initialized and supports both Reader and Writer interface.

Conversion of a Buffer into a []byte:

var buffer bytes.Buffer
bytes := buffer.Bytes()