本文整理汇总了Golang中git/masontest/com/branches/gomysqlproxy/app/models/bytes2.ChunkedWriter.Reserve方法的典型用法代码示例。如果您正苦于以下问题:Golang ChunkedWriter.Reserve方法的具体用法?Golang ChunkedWriter.Reserve怎么用?Golang ChunkedWriter.Reserve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类git/masontest/com/branches/gomysqlproxy/app/models/bytes2.ChunkedWriter
的用法示例。
在下文中一共展示了ChunkedWriter.Reserve方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: putUint64
func putUint64(buf *bytes2.ChunkedWriter, val uint64) {
Pack.PutUint64(buf.Reserve(WORD64), val)
}
示例2: NewLenWriter
// NewLenWriter returns a LenWriter that reserves the
// bytes buf so they can store the length later.
func NewLenWriter(buf *bytes2.ChunkedWriter) LenWriter {
off := buf.Len()
b := buf.Reserve(WORD32)
return LenWriter{buf, off, b}
}
示例3: putUint32
func putUint32(buf *bytes2.ChunkedWriter, val uint32) {
Pack.PutUint32(buf.Reserve(WORD32), val)
}
示例4: EncodePrefix
// EncodePrefix encodes key as prefix for the next object or value.
func EncodePrefix(buf *bytes2.ChunkedWriter, etype byte, key string) {
b := buf.Reserve(len(key) + 2)
b[0] = etype
copy(b[1:], key)
b[len(b)-1] = 0
}