Add pool support everywhere

This commit is contained in:
9seconds
2020-03-24 11:22:59 +03:00
parent 9125a29e79
commit 837d96dc43
13 changed files with 162 additions and 62 deletions
+10 -3
View File
@@ -1,5 +1,7 @@
package tlstypes
import "io"
type RecordType uint8
const (
@@ -69,11 +71,16 @@ var (
)
type Byter interface {
Bytes() []byte
WriteBytes(io.Writer)
Len() int
}
type RawBytes []byte
func (r RawBytes) Bytes() []byte {
return []byte(r)
func (r RawBytes) WriteBytes(writer io.Writer) {
writer.Write(r) // nolint: errcheck
}
func (r RawBytes) Len() int {
return len(r)
}