// Data gets content of blob all at once and wrap it as io.Reader.
// This can be very slow and memory consuming for huge content.
481599
func (b *Blob) Data() (io.Reader, error) {
	stdout := new(bytes.Buffer)
	stderr := new(bytes.Buffer)

	// Preallocate memory to save ~50% memory usage on big files.
	stdout.Grow(int(b.Size() + 2048))

	if err := b.DataPipeline(stdout, stderr); err != nil {
		return nil, concatenateError(err, stderr.String())
	}
	return stdout, nil
}
844298
func (s *Secret) Data() map[string]interface{} {
	if s.d == nil {
		s.d = make(map[string]interface{})
	}
	return s.d
}
818569
func (r *Reader) ReadByte() (byte, error) {
	for r.buffered() < 1 && r.state == nil {
		r.more()
	}
	if r.buffered() < 1 {
		return 0, r.err()
	}
	b := r.data[r.n]
	r.n++
	return b, nil
}
1121181
func WrapBytes(b []byte, lim int) []byte {
	words := bytes.Split(bytes.Replace(bytes.TrimSpace(b), nl, sp, -1), sp)
	var lines [][]byte
	for _, line := range WrapWords(words, 1, lim, defaultPenalty) {
		lines = append(lines, bytes.Join(line, sp))
	}
	return bytes.Join(lines, nl)
}
1287430
func (j *JsonQuery) String(s ...string) (string, error) {
	val, err := rquery(j.blob, s...)
	if err != nil {
		return "", err
	}
	return stringFromInterface(val)
}
768908
func (g *Container) Bytes() []byte {
	if g.Data() != nil {
		if bytes, err := json.Marshal(g.object); err == nil {
			return bytes
		}
	}
	return []byte("{}")
}
680210
func readBlob(reader *bufio.Reader) ([]byte, int, error) {
	// First, get the length
	var blobLen int32
	if err := binary.Read(reader, binary.BigEndian, &blobLen); err != nil {
		return nil, 0, err
	}
	n := 4 + int(blobLen)

	// Read the data
	blob := make([]byte, blobLen)
	if _, err := reader.Read(blob); err != nil {
		return nil, 0, err
	}

	// Remove the padding bytes
	numPadBytes := padBytesNeeded(int(blobLen))
	if numPadBytes > 0 {
		n += numPadBytes
		dummy := make([]byte, numPadBytes)
		if _, err := reader.Read(dummy); err != nil {
			return nil, 0, err
		}
	}

	return blob, n, nil
}
501459
func (r *Reader) Read(b []byte) (int, error) {
	// if we have data in the buffer, just
	// return that.
	if r.buffered() != 0 {
		x := copy(b, r.data[r.n:])
		r.n += x
		return x, nil
	}
	var n int
	// we have no buffered data; determine
	// whether or not to buffer or call
	// the underlying reader directly
	if len(b) >= cap(r.data) {
		n, r.state = r.r.Read(b)
	} else {
		r.more()
		n = copy(b, r.data)
		r.n = n
	}
	if n == 0 {
		return 0, r.err()
	}
	return n, nil
}
1360181
func (res *MCResponse) Bytes() []byte {
	data := make([]byte, res.Size())

	pos := res.fillHeaderBytes(data)

	copy(data[pos:pos+len(res.Body)], res.Body)

	return data
}
868136
func (l *lexer) blob() string {
	return l.input[l.start:l.pos]
}
507560
func DataWithContentType(filename string, source io.Reader, contentType string) *BinaryData {
	return &BinaryData{
		Filename:    filename,
		Source:      source,
		ContentType: contentType,
	}
}
466931
func LoadData(data []byte) (*File, error) {
	r := newLineReader(string(data))
	var file File
	for {
		var msg Message
		if err := msg.readPoEntry(r); err != nil {
			if err == io.EOF {
				return &file, nil
			}
			return nil, err
		}
		if msg.MsgId == "" {
			file.MimeHeader.parseHeader(&msg)
			continue
		}
		file.Messages = append(file.Messages, msg)
	}
}
79414
func (b *Buffer) Bytes() []byte {
	if b.Len() == 0 {
		return nil
	}

	m := make([]byte, 0, b.Len())
	idx := b.fidx
	for cur := b.first; cur != nil; cur = cur.next {
		m = append(m, cur.Bytes()[idx:]...)
		idx = 0
	}
	return m
}
690869
func (t *Tree) Data() []interface{} {
	arr := make([]interface{}, t.Len())
	var i int
	i = 0
	t.Do(func(v interface{}) bool {
		arr[i] = v
		i++
		return true
	})
	return arr
}
1230954
func Read(b []byte) (n int, err error) {
	return io.ReadFull(Reader, b)
}
627480
func (td *MergingDigest) Data() *MergingDigestData {
	td.mergeAllTemps()
	return &MergingDigestData{
		MainCentroids: td.mainCentroids,
		Compression:   td.compression,
		Min:           td.min,
		Max:           td.max,
		ReciprocalSum: td.reciprocalSum,
	}
}
959181
func (b *Buffer) AppendBytes(data []byte) {
	for len(data) > 0 {
		if cap(b.Buf) == len(b.Buf) { // EnsureSpace won't be inlined.
			b.EnsureSpace(1)
		}

		sz := cap(b.Buf) - len(b.Buf)
		if sz > len(data) {
			sz = len(data)
		}

		b.Buf = append(b.Buf, data[:sz]...)
		data = data[sz:]
	}
}