Lines Matching defs:bytes
5 package bytes
15 // A Buffer is a variable-sized buffer of bytes with Read and Write methods.
18 buf []byte // contents are the bytes buf[off : len(buf)]
40 var ErrTooLarge = errors.New("bytes.Buffer: too large")
42 // Bytes returns a slice of length b.Len() holding the unread portion of the buffer.
47 func (b *Buffer) Bytes() []byte { return b.buf[b.off:] }
59 // Len returns the number of bytes of the unread portion of the buffer;
60 // b.Len() == len(b.Bytes()).
67 // Truncate discards all but the first n unread bytes from the buffer
74 panic("bytes.Buffer: truncation out of range")
87 // grow grows the buffer to guarantee space for n more bytes.
88 // It returns the index where bytes should be written.
120 // another n bytes. After Grow(n), at least n bytes can be written to the
126 panic("bytes.Buffer.Grow: negative count")
151 // Buffer.ReadFrom. As long as the Buffer has at least MinRead bytes beyond
157 // the buffer as needed. The return value n is the number of bytes read. Any
205 // The return value n is the number of bytes written; it always fits into an
214 panic("bytes.Buffer.WriteTo: invalid Write count")
221 // all bytes should have been written, by definition of
259 // Read reads the next len(p) bytes from the buffer or until the buffer
260 // is drained. The return value n is the number of bytes read. If the
281 // Next returns a slice containing the next n bytes from the buffer,
282 // advancing the buffer as if the bytes had been returned by Read.
283 // If there are fewer than n bytes in the buffer, Next returns the entire buffer.
316 // If no bytes are available, the error returned is io.EOF.
317 // If the bytes are an erroneous UTF-8 encoding, it
345 return errors.New("bytes.Buffer: UnreadRune: previous operation was not ReadRune")
359 return errors.New("bytes.Buffer: UnreadByte: previous operation was not a read")