protected byte[] encodeContact(DHTTransportContact contact) { try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); DataOutputStream dos = new DataOutputStream(baos); contact.exportContact(dos); dos.close(); return (baos.toByteArray()); } catch (Throwable e) { log(e); return (null); } }
protected byte[] encodePublishValue(DHTTransportContact contact) { try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); DataOutputStream dos = new DataOutputStream(baos); dos.writeByte(0); // version contact.exportContact(dos); dos.close(); return (baos.toByteArray()); } catch (Throwable e) { log(e); return (new byte[0]); } }