private static byte[] makeConnectionMessage(Counter.Value value)
throws IOException {
ByteArrayOutputStream out = new ByteArrayOutputStream();
CodedOutputStream codedOutput = CodedOutputStream.newInstance(out);
codedOutput.writeRawLittleEndian32(value.getSerializedSize());
value.writeTo(codedOutput);
codedOutput.flush();
byte[] all = out.toByteArray();
return all;