code: public byte[] toArray(int start, int end) {
          checkIndex(start);
          checkIndex(end);
          byte[] result = new byte[start > end ? 0 : end - start];
          
          for (int i = start; i < end; i++) {
              result[i] = getByte(i);
          }
          
          return result;
      }
docs: Returns the range of bytes beginning at the start position and exclusive of the end position.
  If the start position is greater than or equal to the end position, an empty array is
  returned.
  
  @param start Starting position.
  @param end Ending position.
  @return Byte array.
  @exception IndexOutOfBoundsException If an index is out of bounds.