code: public List<Data> read(int bucketId, int elementOffset, int numberToRead) throws FileLockException, IOException {
          String filename = gp.DATABASE_DIRECTORY + "/" + hashFunction.getFilename(bucketId);
          HeaderIndexFile<Data> indexFile = new HeaderIndexFile<Data>(filename, HeaderIndexFile.AccessMode.READ_ONLY,
                  gp.HEADER_FILE_LOCK_RETRY, gp);
  
          List<Data> result = new ArrayList<Data>();
          // where to start
          long actualOffset = elementOffset * gp.getElementSize();
  
          // get the complete buffer
          ByteBuffer dataBuffer = ByteBuffer.allocate(numberToRead * gp.getElementSize());
          indexFile.read(actualOffset, dataBuffer);
          dataBuffer.flip();
  
          byte[] dataArray = new byte[gp.getElementSize()];
          while (dataBuffer.position() < dataBuffer.limit()) {
              dataBuffer.get(dataArray);
              @SuppressWarnings("unchecked")
              Data copy = (Data) prototype.fromByteBuffer(ByteBuffer.wrap(dataArray));
              result.add(copy);
          }
          indexFile.close();
          return result;
      }
docs: Reads <code>numberToRead</code> elements (or less if there are not enough elements) from the bucket with the
  given <code>bucketId</code> beginning at the element offset.
  
  @param bucketId
  the id of the bucket where to read the elements from
  @param elementOffset
  the byte offset, where to start reading
  @param numberToRead
  the number of elements to read
  @return ArrayList containing the data-objects
  @throws FileLockException
  @throws IOException