private int writeDedicatedAttributeRecord(int dedicatedAttributeRecordId,
                                            int fileId,
                                            int attributeId,
                                            byte[] newValueBytes,
                                            int newValueSize) throws IOException {
    return storage.writeToRecord(dedicatedAttributeRecordId, buffer -> {
      ByteBuffer toWrite = ensureLimit(buffer, AttributesRecord.dedicatedRecordSizeForValueSize(newValueSize));
      return AttributesRecord
        .putDedicatedValueRecordHeader(toWrite, fileId, attributeId)
        .put(newValueBytes, 0, newValueSize);
    });
  }
private int writeDedicatedAttributeRecord(int dedicatedAttributeRecordId,
                                            int fileId,
                                            int attributeId,
                                            byte[] newValueBytes,
                                            int newValueSize)