blob: 2376d65f21a6213f0f8d8d0bf70d375262ecc72a (
about) (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
package blob
import (
"lindenii.org/go/furgit/object/header"
"lindenii.org/go/furgit/object/typ"
)
// AppendWithoutHeader renders the raw blob body bytes.
func (blob *Blob) AppendWithoutHeader(dst []byte) ([]byte, error) {
return append(dst, blob.Data...), nil
}
// AppendWithHeader renders the raw object (header + body).
func (blob *Blob) AppendWithHeader(dst []byte) ([]byte, error) {
dst = header.Append(dst, typ.Blob, uint64(len(blob.Data)))
return blob.AppendWithoutHeader(dst)
}
|