}
}
private byte[] convertNdefMessage(Record... records) {
TagOutputStream out = new TagOutputStream(getMaxSize());
TypeLengthValueWriter writer = new TypeLengthValueWriter(out);
if (memoryLayout.hasDynamicLockBytes()) {
writer.write(memoryLayout.createLockControlTlv());
}
writer.write(new NdefMessageTlv(convertRecordsToBytes(records)));
writer.close();
return out.getBuffer();
}