diff options
Diffstat (limited to 'object/store/packed/read_bytes.go')
| -rw-r--r-- | object/store/packed/read_bytes.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/object/store/packed/read_bytes.go b/object/store/packed/read_bytes.go index 333cfaae..98ae6995 100644 --- a/object/store/packed/read_bytes.go +++ b/object/store/packed/read_bytes.go @@ -9,6 +9,10 @@ import ( ) // ReadBytesContent reads an object's type and content bytes. +// +// It fully resolves the requested object bytes. For base pack entries, this +// includes verifying that the zlib stream inflates to exactly the declared +// object size and reaches its Adler-32 trailer. func (store *Store) ReadBytesContent(id objectid.ObjectID) (objecttype.Type, []byte, error) { loc, err := store.lookup(id) if err != nil { @@ -19,6 +23,10 @@ func (store *Store) ReadBytesContent(id objectid.ObjectID) (objecttype.Type, []b } // ReadBytesFull reads a full serialized object as "type size\0content". +// +// Like ReadBytesContent, it fully resolves the requested object bytes. For +// base pack entries, this includes verifying that the zlib stream inflates to +// exactly the declared object size and reaches its Adler-32 trailer. func (store *Store) ReadBytesFull(id objectid.ObjectID) ([]byte, error) { ty, content, err := store.ReadBytesContent(id) if err != nil { |
