mediamtx/internal/rtmp/bytecounter/readwriter.go
2022-09-17 21:19:45 +02:00

21 lines
383 B
Go

// Package bytecounter contains a reader/writer that allows to count bytes.
package bytecounter
import (
"io"
)
// ReadWriter allows to count read and written bytes.
type ReadWriter struct {
*Reader
*Writer
}
// NewReadWriter allocates a ReadWriter.
func NewReadWriter(rw io.ReadWriter) *ReadWriter {
return &ReadWriter{
Reader: NewReader(rw),
Writer: NewWriter(rw),
}
}