예제 #1
0
파일: topic.go 프로젝트: justmao945/tama
func (i *index) Bytes() []byte {
	b := make([]byte, headerSize)
	w := bytes.NewWriter(b[4:])
	binary.Write(w, binary.LittleEndian, i)
	binary.LittleEndian.PutUint32(b, crc32.ChecksumIEEE(b[4:]))
	return b
}
예제 #2
0
파일: ext.go 프로젝트: shaalx/leetcode
func Qiniu() {
	data["Content"] = "Qiniu"
	buf := make([]byte, 100, 100)
	r := qby.NewReader(buf)
	w := qby.NewWriter(buf)
	err := tpl.Execute(w, data)
	fmt.Println("error:", err)
	bs := r.Bytes()
	fmt.Println("reader bytes:", string(bs), "|")
	fmt.Println("origin bytes:", string(buf), "|")
	data["Content"] = "Ya"
	w.Reset()
	tpl.Execute(w, data)
	fmt.Println("reader2 bytes:", string(r.Bytes()), "|", string(w.Bytes()), "|")
}
예제 #3
0
파일: main.go 프로젝트: everfore/rpcsv
func init() {
	// rpcsv.UpdataTheme()

	buf = make([]byte, 8096)
	qiniuWriter = qiniubytes.NewWriter(buf)
}