How i can use Protobuffer using a tcp connection?

93 Views Asked by At

I want so send protobuffer to a server which do something with the protobuffer, im developing on android studio.

private OutputStream toServer ;  

public void serialize(byte[]message) throws IOException {
  try{
           toServer= new ObjectOutputStream(new BufferedOutputStream(socket.getOutputStream()));
           toServer.write(message);
           toServer.write(message,0,message.length);

           toServer.flush();
}
  catch (java.net.SocketException e){     
  e.printStackTrace();
       }
0

There are 0 best solutions below