mirror of
https://github.com/aler9/gortsplib
synced 2025-10-04 23:02:45 +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:
@@ -97,7 +97,7 @@ func (h *Header) read(rb *bufio.Reader) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (h Header) writeSize() int {
|
||||
func (h Header) marshalSize() int {
|
||||
// sort headers by key
|
||||
// in order to obtain deterministic results
|
||||
keys := make([]string, len(h))
|
||||
@@ -119,7 +119,7 @@ func (h Header) writeSize() int {
|
||||
return n
|
||||
}
|
||||
|
||||
func (h Header) writeTo(buf []byte) int {
|
||||
func (h Header) marshalTo(buf []byte) int {
|
||||
// sort headers by key
|
||||
// in order to obtain deterministic results
|
||||
keys := make([]string, len(h))
|
||||
@@ -141,8 +141,8 @@ func (h Header) writeTo(buf []byte) int {
|
||||
return pos
|
||||
}
|
||||
|
||||
func (h Header) write() []byte {
|
||||
buf := make([]byte, h.writeSize())
|
||||
h.writeTo(buf)
|
||||
func (h Header) marshal() []byte {
|
||||
buf := make([]byte, h.marshalSize())
|
||||
h.marshalTo(buf)
|
||||
return buf
|
||||
}
|
||||
|
Reference in New Issue
Block a user