baos = new ByteArrayOutputStream();
oos = new ObjectOutputStream(baos);
oos.writeObject(l);
return baos.toByteArray();
} catch (Exception e) {
throw new EncodeException("cannot encode data");
} finally {
IOHelper.closeQuietly(baos);
IOHelper.closeQuietly(oos);
}
}