mirror of
https://github.com/bluenviron/mediamtx
synced 2024-12-14 10:45:08 +00:00
21 lines
383 B
Go
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),
|
|
}
|
|
}
|