@Test public void toByteArrayAndBack() { byte[] arrayA = delRequest.toByteArray(); byte[] arrayB; arrayB = new EmailPacketDeleteRequest(arrayA).toByteArray(); assertArrayEquals("The two arrays differ!", arrayA, arrayB); }
@Override public byte[] toByteArray() { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); try { writeHeader(outputStream); outputStream.write(dhtKey.toByteArray()); outputStream.write(authorization.toByteArray()); } catch (IOException e) { log.error("Can't write to ByteArrayOutputStream.", e); } return outputStream.toByteArray(); }
EmailPacketDeleteRequest extends DeleteRequest { @Override public byte[] toByteArray() { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); try { writeHeader(outputStream); outputStream.write(dhtKey.toByteArray()); outputStream.write(authorization.toByteArray()); } catch (IOException e) { log.error("Can't write to ByteArrayOutputStream.", e); } return outputStream.toByteArray(); } }
EmailPacketDeleteRequest extends DeleteRequest { @Override public byte[] toByteArray() { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); try { writeHeader(outputStream); outputStream.write(dhtKey.toByteArray()); outputStream.write(authorization.toByteArray()); } catch (IOException e) { log.error("Can't write to ByteArrayOutputStream.", e); } return outputStream.toByteArray(); } EmailPacketDeleteRequest(Hash dhtKey, UniqueId authorization);  EmailPacketDeleteRequest(byte[] data); }
EmailPacketDeleteRequest extends DeleteRequest { @Override public byte[] toByteArray() { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); try { writeHeader(outputStream); outputStream.write(dhtKey.toByteArray()); outputStream.write(authorization.toByteArray()); } catch (IOException e) { log.error("Can't write to ByteArrayOutputStream.", e); } return outputStream.toByteArray(); } EmailPacketDeleteRequest(Hash dhtKey, UniqueId authorization);  EmailPacketDeleteRequest(byte[] data); Hash getDhtKey(); UniqueId getAuthorization(); @Override byte[] toByteArray(); @Override Class<? extends I2PBotePacket> getDataType(); @Override Collection<Hash> getDhtKeys(); @Override DeleteRequest getIndividualRequest(Hash dhtKey); @Override String toString(); }
EmailPacketDeleteRequest extends DeleteRequest { @Override public byte[] toByteArray() { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); try { writeHeader(outputStream); outputStream.write(dhtKey.toByteArray()); outputStream.write(authorization.toByteArray()); } catch (IOException e) { log.error("Can't write to ByteArrayOutputStream.", e); } return outputStream.toByteArray(); } EmailPacketDeleteRequest(Hash dhtKey, UniqueId authorization);  EmailPacketDeleteRequest(byte[] data); Hash getDhtKey(); UniqueId getAuthorization(); @Override byte[] toByteArray(); @Override Class<? extends I2PBotePacket> getDataType(); @Override Collection<Hash> getDhtKeys(); @Override DeleteRequest getIndividualRequest(Hash dhtKey); @Override String toString();  }