add Prepend() for iovec
This commit is contained in:
parent
a623b75470
commit
7a1c3ed2cc
5
vecio.go
5
vecio.go
@ -17,6 +17,11 @@ type iovec struct {
|
|||||||
idx int
|
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) {
|
func (self *iovec) Append(b []byte) {
|
||||||
self.data = append(self.data, b)
|
self.data = append(self.data, b)
|
||||||
self.Len += len(b)
|
self.Len += len(b)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user