+ /**
+ * Push back some data that will be read again at the next read call.
+ *
+ * @param buffer
+ * the buffer to push back
+ * @param offset
+ * the offset at which to start reading in the buffer
+ * @param len
+ * the length to copy
+ */
+ protected void pushback(byte[] buffer, int offset, int len) {
+ // TODO: not efficient!
+ if (buffer.length != len) {
+ byte[] lenNotSupportedYet = new byte[len];
+ System.arraycopy(buffer, offset, lenNotSupportedYet, 0, len);
+ buffer = lenNotSupportedYet;
+ offset = 0;
+ }
+
+ pushback(buffer, offset);
+ }
+