add Prepend() for iovec

This commit is contained in:
nareix 2016-03-09 01:26:25 +08:00
parent a623b75470
commit 7a1c3ed2cc

View File

@ -17,6 +17,11 @@ type iovec struct {
idx int
}
func (self *iovec) Prepend(b []byte) {
self.data = append([][]byte{b}, self.data...)
self.Len += len(b)
}
func (self *iovec) Append(b []byte) {
self.data = append(self.data, b)
self.Len += len(b)