@Test public void encode() { codec.encode(packet); assertThat((InterledgerFulfillment) codec.getValueAt(0)) .isEqualTo(InterledgerFulfillment.of(new byte[32])); final byte[] encodedIldcpResponseBytes = codec.getValueAt(1); assertThat(Base64.getEncoder().encodeToString(encodedIldcpResponseBytes)).isEqualTo("C2V4YW1wbGUuZm9vCQNCVEM="); }
@Override public void encode(IldcpResponsePacket value) { final ByteArrayOutputStream os = new ByteArrayOutputStream(); try { IldcpCodecContextFactory.oer().write(value.getIldcpResponse(), os); } catch (IOException e) { throw new IldcpCodecException(e.getMessage(), e); } setValueAt(0, value.getFulfillment()); setValueAt(1, os.toByteArray()); }
AsnIldcpResponsePacketDataCodec extends AsnSequenceCodec<IldcpResponsePacket> { @Override public void encode(IldcpResponsePacket value) { final ByteArrayOutputStream os = new ByteArrayOutputStream(); try { IldcpCodecContextFactory.oer().write(value.getIldcpResponse(), os); } catch (IOException e) { throw new IldcpCodecException(e.getMessage(), e); } setValueAt(0, value.getFulfillment()); setValueAt(1, os.toByteArray()); } }
AsnIldcpResponsePacketDataCodec extends AsnSequenceCodec<IldcpResponsePacket> { @Override public void encode(IldcpResponsePacket value) { final ByteArrayOutputStream os = new ByteArrayOutputStream(); try { IldcpCodecContextFactory.oer().write(value.getIldcpResponse(), os); } catch (IOException e) { throw new IldcpCodecException(e.getMessage(), e); } setValueAt(0, value.getFulfillment()); setValueAt(1, os.toByteArray()); } AsnIldcpResponsePacketDataCodec(); }
AsnIldcpResponsePacketDataCodec extends AsnSequenceCodec<IldcpResponsePacket> { @Override public void encode(IldcpResponsePacket value) { final ByteArrayOutputStream os = new ByteArrayOutputStream(); try { IldcpCodecContextFactory.oer().write(value.getIldcpResponse(), os); } catch (IOException e) { throw new IldcpCodecException(e.getMessage(), e); } setValueAt(0, value.getFulfillment()); setValueAt(1, os.toByteArray()); } AsnIldcpResponsePacketDataCodec(); @Override IldcpResponsePacket decode(); @Override void encode(IldcpResponsePacket value); }
AsnIldcpResponsePacketDataCodec extends AsnSequenceCodec<IldcpResponsePacket> { @Override public void encode(IldcpResponsePacket value) { final ByteArrayOutputStream os = new ByteArrayOutputStream(); try { IldcpCodecContextFactory.oer().write(value.getIldcpResponse(), os); } catch (IOException e) { throw new IldcpCodecException(e.getMessage(), e); } setValueAt(0, value.getFulfillment()); setValueAt(1, os.toByteArray()); } AsnIldcpResponsePacketDataCodec(); @Override IldcpResponsePacket decode(); @Override void encode(IldcpResponsePacket value);  }