summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/buffer/prependable.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/tcpip/buffer/prependable.go')
-rw-r--r--pkg/tcpip/buffer/prependable.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/tcpip/buffer/prependable.go b/pkg/tcpip/buffer/prependable.go
index 4287464f3..48a2a2713 100644
--- a/pkg/tcpip/buffer/prependable.go
+++ b/pkg/tcpip/buffer/prependable.go
@@ -41,6 +41,11 @@ func NewPrependableFromView(v View) Prependable {
return Prependable{buf: v, usedIdx: 0}
}
+// NewEmptyPrependableFromView creates a new prependable buffer from a View.
+func NewEmptyPrependableFromView(v View) Prependable {
+ return Prependable{buf: v, usedIdx: len(v)}
+}
+
// View returns a View of the backing buffer that contains all prepended
// data so far.
func (p Prependable) View() View {