Matheus Sampaio Queiroga
c756fc28b0
Signed-off-by: Matheus Sampaio Queiroga <srherobrine20@gmail.com>
22 lines
377 B
Go
22 lines
377 B
Go
package proto
|
|
|
|
import (
|
|
"fmt"
|
|
"io"
|
|
)
|
|
|
|
type RawSlice []byte
|
|
|
|
func (buff RawSlice) ReadFrom(r io.Reader) error {
|
|
return fmt.Errorf("cannot read for RawSlice")
|
|
}
|
|
func (buff RawSlice) WriteTo(w io.Writer) error {
|
|
size, err := w.Write(buff)
|
|
if err != nil {
|
|
return err
|
|
} else if size != len(buff) {
|
|
return fmt.Errorf("not enough space to write raw slice")
|
|
}
|
|
return nil
|
|
}
|