code: @Override
    public ByteBuffer next() throws IOException, NoSuchElementException {
      Record record = readPhysicalRecord(true);
      while (record.type().equals(RecordType.NONE)) {
        validateBufferIsZeros(record.data());
        record = readPhysicalRecord(true);
      }
      if (record.type().equals(RecordType.FULL)) {
        return record.data();
      }
      if (record.type().equals(RecordType.FIRST)) {
        ArrayList<ByteBuffer> result = new ArrayList<>();
        result.add(record.data());
        record = readPhysicalRecord(false);
        while (record.type().equals(RecordType.MIDDLE)) {
          result.add(record.data());
          record = readPhysicalRecord(false);
        }
        if (!record.type().equals(RecordType.LAST)) {
          throw new CorruptDataException("Unterminated first block. Found: " + record.type.value());
        }
        result.add(record.data());
        return copyAll(result);
      }
      throw new CorruptDataException("Unexpected RecordType: " + record.type.value());
    }
docs: {@inheritDoc}