diff --git a/lib/util.cpp b/lib/util.cpp
index 8dd75727..d4ff380f 100644
--- a/lib/util.cpp
+++ b/lib/util.cpp
@@ -191,6 +191,17 @@ namespace Util{
     maxSize = 0;
   }
 
+  void ResizeablePointer::shift(size_t byteCount){
+    //Shifting the entire buffer is easy, we do nothing and set size to zero
+    if (byteCount >= currSize){
+      currSize = 0;
+      return;
+    }
+    //Shifting partial needs a memmove and size change
+    memmove(ptr, ((char*)ptr)+byteCount, currSize-byteCount);
+    currSize -= byteCount;
+  }
+
   bool ResizeablePointer::assign(const void *p, uint32_t l){
     if (!allocate(l)){return false;}
     memcpy(ptr, p, l);
diff --git a/lib/util.h b/lib/util.h
index 84b0d56c..d28a7f76 100644
--- a/lib/util.h
+++ b/lib/util.h
@@ -45,6 +45,7 @@ namespace Util{
     bool append(const void *p, uint32_t l);
     bool append(const std::string &str);
     bool allocate(uint32_t l);
+    void shift(size_t byteCount);
     uint32_t rsize();
     void truncate(const size_t newLen);
     inline operator char *(){return (char *)ptr;}