Skip to content

Commit ee4b62c

Browse files
authored
encoding: fix mention of DecompressedSize in docstring (#6665)
1 parent 09792b5 commit ee4b62c

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

encoding/encoding.go

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ const Identity = "identity"
3838

3939
// Compressor is used for compressing and decompressing when sending or
4040
// receiving messages.
41+
//
42+
// If a Compressor implements `DecompressedSize(compressedBytes []byte) int`,
43+
// gRPC will invoke it to determine the size of the buffer allocated for the
44+
// result of decompression. A return value of -1 indicates unknown size.
4145
type Compressor interface {
4246
// Compress writes the data written to wc to w after compressing it. If an
4347
// error occurs while initializing the compressor, that error is returned
@@ -51,15 +55,6 @@ type Compressor interface {
5155
// coding header. The result must be static; the result cannot change
5256
// between calls.
5357
Name() string
54-
// If a Compressor implements
55-
// DecompressedSize(compressedBytes []byte) int, gRPC will call it
56-
// to determine the size of the buffer allocated for the result of decompression.
57-
// Return -1 to indicate unknown size.
58-
//
59-
// Experimental
60-
//
61-
// Notice: This API is EXPERIMENTAL and may be changed or removed in a
62-
// later release.
6358
}
6459

6560
var registeredCompressor = make(map[string]Compressor)

0 commit comments

Comments
 (0)