private static byte[] readDedicatedRecordPayload(int dedicatedAttributeRecordId,
                                                   int fileId,
                                                   int attributeId,
                                                   ByteBuffer dedicatedRecordBuffer) throws IOException {
    if (dedicatedRecordBuffer.remaining() < AttributesRecord.DEDICATED_RECORD_HEADER_SIZE) {
      throw new CorruptedException(
        "record(" + dedicatedAttributeRecordId + ", fileId: " + fileId + ", " + attributeId + ") is too short for dedicated record: " +
        dedicatedRecordBuffer.remaining() + " b in buffer < " + AttributesRecord.DEDICATED_RECORD_HEADER_SIZE + " b header"
      );
    }
    int backRefFileId = -dedicatedRecordBuffer.getInt(AttributesRecord.RECORD_FILE_ID_OFFSET);
    int backRefAttributeId = dedicatedRecordBuffer.getInt(AttributesRecord.DEDICATED_RECORD_ATTRIBUTE_ID_OFFSET);
    if (backRefFileId != fileId) {
      throw new CorruptedException("record(" + dedicatedAttributeRecordId + ").fileId(" + fileId + ") " +
                                   "!= backref fileId(" + backRefFileId + "), buffer remains: " +
                                   IOUtil.toHexString(dedicatedRecordBuffer)
      );
    }
    if (backRefAttributeId != attributeId) {
      throw new CorruptedException("record(" + dedicatedAttributeRecordId + ").attributeId(" + attributeId + ") " +
                                   "!= backref attributeId(" + backRefAttributeId + "), buffer remains: " +
                                   IOUtil.toHexString(dedicatedRecordBuffer)
      );
    }

    int valueLength = dedicatedRecordBuffer.remaining() - AttributesRecord.DEDICATED_RECORD_HEADER_SIZE;
    byte[] entryValue = new byte[valueLength];
    dedicatedRecordBuffer.get(AttributesRecord.DEDICATED_RECORD_HEADER_SIZE, entryValue);
    return entryValue;
  }
private static byte[] readDedicatedRecordPayload(int dedicatedAttributeRecordId,
                                                   int fileId,
                                                   int attributeId,
                                                   ByteBuffer dedicatedRecordBuffer)