将整数转化成字符串,如value="12",在接收端采用Integer.parseInt("12")或者Integer.valueOf("12");,适当的话捕获一下异常就可以得到你要的整数了

解决方案 »

  1.   

    将整数转化成字符串,如value="12",在接收端采用Integer.parseInt("12")或者Integer.valueOf("12");,适当的话捕获一下异常就可以得到你要的整数了
      

  2.   

           byte[] mydata = xxxxxx;//网络获得的流,如果你发的确实是int就可以 ByteBuffer 很好用
            ByteBuffer b = ByteBuffer.allocate(4);
            b.put(mydata);
            b.flip();
            int value = b.getInt();