import io, math, os
from bup import _helpers, compat, helpers
-from bup.compat import buffer, join_bytes
+from bup._helpers import cat_bytes
+from bup.compat import buffer, py_maj
from bup.helpers import sc_page_size
def put(self, s):
if s:
- self.data = join_bytes(buffer(self.data, self.start), s)
+ remaining = len(self.data) - self.start
+ self.data = cat_bytes(self.data, self.start, remaining,
+ s, 0, len(s))
self.start = 0
def peek(self, count):
+ if count <= 256:
+ return self.data[self.start : self.start + count]
return buffer(self.data, self.start, count)
def eat(self, count):