@Test public void testSerializeRequestStoresBytesInMessage() { Request req = Request.newGet(); req.setToken(new byte[] { 0x00 }); req.getOptions().setObserve(0); req.setDestinationContext(new AddressEndpointContext(InetAddress.getLoopbackAddress(), CoAP.DEFAULT_COAP_PORT)); RawData raw = serializer.serializeRequest(req); assertNotNull(req.getBytes()); assertThat(raw.getBytes(), is(req.getBytes())); assertThat(raw.getEndpointContext(), is(req.getDestinationContext())); }
public final RawData serializeRequest(final Request request) { return serializeRequest(request, null); }
DataSerializer { public final RawData serializeRequest(final Request request) { return serializeRequest(request, null); } }
DataSerializer { public final RawData serializeRequest(final Request request) { return serializeRequest(request, null); }  }
DataSerializer { public final RawData serializeRequest(final Request request) { return serializeRequest(request, null); }  final byte[] getByteArray(final Message message); final RawData serializeRequest(final Request request); final RawData serializeRequest(final Request request, final MessageCallback outboundCallback); final RawData serializeResponse(final Response response); final RawData serializeResponse(final Response response, final MessageCallback outboundCallback); final RawData serializeEmptyMessage(final EmptyMessage emptyMessage); final RawData serializeEmptyMessage(final EmptyMessage emptyMessage, final MessageCallback outboundCallback); static void serializeOptionsAndPayload(DatagramWriter writer, final OptionSet optionSet,
			final byte[] payload); }
DataSerializer { public final RawData serializeRequest(final Request request) { return serializeRequest(request, null); }  final byte[] getByteArray(final Message message); final RawData serializeRequest(final Request request); final RawData serializeRequest(final Request request, final MessageCallback outboundCallback); final RawData serializeResponse(final Response response); final RawData serializeResponse(final Response response, final MessageCallback outboundCallback); final RawData serializeEmptyMessage(final EmptyMessage emptyMessage); final RawData serializeEmptyMessage(final EmptyMessage emptyMessage, final MessageCallback outboundCallback); static void serializeOptionsAndPayload(DatagramWriter writer, final OptionSet optionSet,
			final byte[] payload);  }