func (v *View) advanceRead(count int64) {
	for buf := v.data.Front(); buf != nil && count > 0; {
		l := int64(buf.write - buf.read)
		if l > count {
			// There is still data for reading.
			buf.read += int(count)
			v.size -= count
			count = 0
			break
		}

		// Read from this buffer.
		buf.read += int(l)
		count -= l
		v.size -= l

		// When all data has been read from a buffer, we push
		// it into the empty buffer pool for reuse.
		oldBuf := buf
		buf = buf.Next() // Iterate.
		v.data.Remove(oldBuf)
		oldBuf.Reset()
		bufferPool.Put(oldBuf)
	}
	if count > 0 {
		panic(fmt.Sprintf("advanceRead still has %d bytes remaining", count))
	}
}
// advanceRead advances the view's read index.
//
// Precondition: there must be sufficient bytes in the buffer.
advanceRead advances the view's read index.

there must be sufficient bytes in the buffer.
// advanceRead advances the view ' s read index . // // Precondition : there must be sufficient bytes in the buffer .
func (v *View) advanceRead(count int64) {
	for buf := v.data.Front(); buf != nil && count > 0; {
		l := int64(buf.write - buf.read)
		if l > count {
			buf.read += int(count)
			v.size -= count
			count = 0
			break
		}
		buf.read += int(l)
		count -= l
		v.size -= l
		oldBuf := buf
		buf = buf.Next() 
		v.data.Remove(oldBuf)
		oldBuf.Reset()
		bufferPool.Put(oldBuf)
	}
	if count > 0 {
		panic(fmt.Sprintf("advanceRead still has %d bytes remaining", count))
	}
}
func ( v * View ) advanceRead ( count int64 ) { for buf := v . data . Front ( ) ; buf != nil && count > 0 ; { l := int64 ( buf . write - buf . read ) if l > count { buf . read += int ( count ) v . size -= count count = 0 break } buf . read += int ( l ) count -= l v . size -= l oldBuf := buf buf = buf . Next ( ) v . data . Remove ( oldBuf ) oldBuf . Reset ( ) bufferPool . Put ( oldBuf ) } if count > 0 { panic ( fmt . Sprintf ( " " , count ) ) } }
advanceRead advances the view's read index.
advanceRead advances the view ' s read index .
// There is still data for reading. // Read from this buffer. // When all data has been read from a buffer, we push // it into the empty buffer pool for reuse. // Iterate.