code: public byte[] remove(int count) throws BufferSizeException {
          if ((count < 0) || (count > capacity())) {
              throw new IllegalArgumentException("Tried to remove " + count + " bytes from buffer. The count must be a value between 0 and " + capacity());
          }
          if (count > size()) {
              throw new BufferSizeException("Buffer size (" + size() + ") not large enough to remove (" + count + ") bytes");
          }
  
          // allocate the new array we'll fill
          byte[] removedBuffer  = new byte[count];
  
          int currentPos = 0;
          // remove each byte :
          for (int i = 0; i < count; i++, currentPos++) {
              try {
                  removedBuffer[currentPos] = this.remove();
              } catch (BufferIsEmptyException e) {
                  // this should be an impossible case since we checked the size() above
                  logger.error("Buffer is empty even though this method checked its size() ahead of time", e);
                  throw new BufferSizeException(e.getMessage());
              }
          }
          
          return removedBuffer;
      }
docs: Removes a byte array of the first N bytes in the buffer. The parameter
  count must be a value between 1 and the capacity of the buffer, otherwise
  a runtime IllegalArgumentException will be thrown.  If the N bytes
  requested is larger than the buffer size, then a <code>BufferSizeException</code>
  will be thrown.
  @param count The number of bytes to remove (a value between 1 and the buffer capacity).
  @return The first N bytes of the buffer.
  @throws BufferSizeException If the buffer is not large enough to fufill the request
  (if N is > size)