Search in sources :

Example 1 with ProtoWriter

use of com.squareup.wire.ProtoWriter in project zipkin by openzipkin.

the class Proto3CodecInteropTest method encodeIsCompatible.

@Test
public void encodeIsCompatible() throws IOException {
    okio.Buffer buffer = new okio.Buffer();
    Span.ADAPTER.encodeWithTag(new ProtoWriter(buffer), 1, PROTO_SPAN);
    assertThat(SpanBytesEncoder.PROTO3.encode(ZIPKIN_SPAN)).containsExactly(buffer.readByteArray());
}
Also used : ProtoWriter(com.squareup.wire.ProtoWriter) Test(org.junit.Test)

Example 2 with ProtoWriter

use of com.squareup.wire.ProtoWriter in project wire by square.

the class EncodeBenchmark method wire3x.

@Benchmark
public void wire3x() throws IOException {
    ProtoWriter writer = new ProtoWriter(buffer);
    EmailSearchResponse.ADAPTER.encode(writer, SampleData.newMediumValueWire());
    buffer.clear();
}
Also used : ProtoWriter(com.squareup.wire.ProtoWriter) ReverseProtoWriter(com.squareup.wire.ReverseProtoWriter) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Aggregations

ProtoWriter (com.squareup.wire.ProtoWriter)2 ReverseProtoWriter (com.squareup.wire.ReverseProtoWriter)1 Test (org.junit.Test)1 Benchmark (org.openjdk.jmh.annotations.Benchmark)1