func (v *View) Flatten() []byte {
	if buf := v.data.Front(); buf.Next() == nil {
		return buf.data[buf.read:buf.write] // Only one buffer.
	}
	data := make([]byte, 0, v.size) // Need to flatten.
	for buf := v.data.Front(); buf != nil; buf = buf.Next() {
		// Copy to the allocated slice.
		data = append(data, buf.data[buf.read:buf.write]...)
	}
	return data
}
// Flatten returns a flattened copy of this data.
//
// This method should not be used in any performance-sensitive paths. It may
// allocate a fresh byte slice sufficiently large to contain all the data in
// the buffer.
//
// N.B. Tee data still belongs to this view, as if there is a single buffer
// present, then it will be returned directly. This should be used for
// temporary use only, and a reference to the given slice should not be held.
Flatten returns a flattened copy of this data.

This method should not be used in any performance-sensitive paths. It may
allocate a fresh byte slice sufficiently large to contain all the data in
the buffer.

N.B. Tee data still belongs to this view, as if there is a single buffer
present, then it will be returned directly. This should be used for
temporary use only, and a reference to the given slice should not be held.
// Flatten returns a flattened copy of this data . // // This method should not be used in any performance - sensitive paths . It may // allocate a fresh byte slice sufficiently large to contain all the data in // the buffer . // // N . B . Tee data still belongs to this view as if there is a single buffer // present then it will be returned directly . This should be used for // temporary use only and a reference to the given slice should not be held .
func (v *View) Flatten() []byte {
	if buf := v.data.Front(); buf.Next() == nil {
		return buf.data[buf.read:buf.write] 
	}
	data := make([]byte, 0, v.size) 
	for buf := v.data.Front(); buf != nil; buf = buf.Next() {
		data = append(data, buf.data[buf.read:buf.write]...)
	}
	return data
}
func ( v * View ) Flatten ( ) [ ] byte { if buf := v . data . Front ( ) ; buf . Next ( ) == nil { return buf . data [ buf . read : buf . write ] } data := make ( [ ] byte , 0 , v . size ) for buf := v . data . Front ( ) ; buf != nil ; buf = buf . Next ( ) { data = append ( data , buf . data [ buf . read : buf . write ] ... ) } return data }
Flatten returns a flattened copy of this data.
Flatten returns a flattened copy of this data .
// Only one buffer. // Need to flatten. // Copy to the allocated slice.