final CodedOutputStream reuseDevNull = reuseDevNullTemp;
benchmark("Serialize to byte string", inputData.length, new Action() {
public void execute() { sampleMessage.toByteString(); }
});
benchmark("Serialize to byte array", inputData.length, new Action() {
public void execute() { sampleMessage.toByteArray(); }
});
benchmark("Serialize to memory stream", inputData.length, new Action() {
public void execute() throws IOException {
sampleMessage.writeTo(new ByteArrayOutputStream());
}