I have a server-client communication channel based on sockets. I packed 3 integer value to byte[] and write it to socket OutputStream, but i how to convert it back?
Pease of code :
ByteBuffer b = ByteBuffer.allocate(12);
b.putInt(BTActions.READY_FOR_GAME);
b.putInt(i);
b.putInt(l);
try
{
mAcceptThread.getWriteSocket().write(b.array());
}
catch (IOException e)
{
e.printStackTrace();
}