mirror of
https://github.com/aler9/gortsplib
synced 2025-10-21 14:19:36 +08:00
rename Read / Write into Unmarshal / Marshal when needed
Read() / Write() are used to read / write from streams, while Unmarshal() / Marshal() are used to decode / encode from / to bytes.
This commit is contained in:
@@ -39,16 +39,16 @@ func (b *body) read(header Header, rb *bufio.Reader) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (b body) writeSize() int {
|
||||
func (b body) marshalSize() int {
|
||||
return len(b)
|
||||
}
|
||||
|
||||
func (b body) writeTo(buf []byte) int {
|
||||
func (b body) marshalTo(buf []byte) int {
|
||||
return copy(buf, b)
|
||||
}
|
||||
|
||||
func (b body) write() []byte {
|
||||
buf := make([]byte, b.writeSize())
|
||||
b.writeTo(buf)
|
||||
func (b body) marshal() []byte {
|
||||
buf := make([]byte, b.marshalSize())
|
||||
b.marshalTo(buf)
|
||||
return buf
|
||||
}
|
||||
|
Reference in New Issue
Block a user