private byte[] serialize(Object object, byte fid) throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); baos.write(fid); try { serialize(baos, object, fid); } catch (Exception e) { LOGGER.log(Level.ERROR, "Error serializing " + object, e); throw e; } baos.close(); return baos.toByteArray(); }
@Override public byte[] serializeException(Exception object) throws Exception { return serialize(object, (byte) FunctionId.OTHER.ordinal()); }