ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputStream outputStream = new DataOutputStream(baos);
try {
outputStream.writeUTF(record);
} catch (IOException ioe) {
System.out.println(ioe);
ioe.printStackTrace();
}
byte[] b = baos.toByteArray();
try {
recordStore.addRecord(b, 0, b.length);
} catch (RecordStoreException rse) {
System.out.println(rse);
rse.printStackTrace();
}