Documentation
¶
Index ¶
- Constants
- Variables
- func ReadBool(buff *bytes.Buffer) (bool, error)
- func ReadData(buff *bytes.Buffer, numType NumType) ([]byte, error)
- func ReadString(buff *bytes.Buffer, numType NumType) (string, error)
- func WriteBool(buff *bytes.Buffer, b bool) error
- func WriteData(buff *bytes.Buffer, data []byte, numType NumType) error
- type BoxData
- type BoxDataIOData
- type BoxReader
- type BoxWriter
- type NumType
- type ReadCloser
- type Reader
- type WriteCloser
- type Writer
Constants ¶
View Source
const MessageSizeMax = 1 << 22 // 4 MB
MessageSizeMax is a soft (recommended) maximum for network messages. One can write more, as the interface is a stream. But it is useful to bunch it up into multiple read/writes when the whole message is a single, large serialized object.
Variables ¶
View Source
var (
BoxMsgIO = &BoxDataIOData{}
)
Functions ¶
Types ¶
type BoxDataIOData ¶
type BoxDataIOData struct { }
func (*BoxDataIOData) ReadMessage ¶
func (that *BoxDataIOData) ReadMessage(stream io.Reader, msg BoxData) error
ReadMessage 读取一个BoxData消息
func (*BoxDataIOData) WriteMessage ¶
type ReadCloser ¶
func NewBoxReader ¶
func NewBoxReader(r io.Reader, maxSize int) ReadCloser
type WriteCloser ¶
func NewBoxWriter ¶
func NewBoxWriter(w io.Writer) WriteCloser
Click to show internal directories.
Click to hide internal directories.