Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronc committed Apr 1, 2022
1 parent 3863add commit 969db41
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions orm/encoding/ormfield/bytes.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ func (b BytesCodec) FixedBufferSize() int {
return -1
}

// ComputeBufferSize returns the bytes size of the value.
func (b BytesCodec) ComputeBufferSize(value protoreflect.Value) (int, error) {
return bytesSize(value), nil
}
Expand Down Expand Up @@ -50,6 +51,8 @@ func (b NonTerminalBytesCodec) FixedBufferSize() int {
return -1
}

// ComputeBufferSize returns the bytes size of the value plus the length of the
// varint length-prefix.
func (b NonTerminalBytesCodec) ComputeBufferSize(value protoreflect.Value) (int, error) {
n := bytesSize(value)
prefixLen := 1
Expand Down

0 comments on commit 969db41

Please sign in to comment.