从DatagramPacket转换为int

时间:2014-10-07 00:10:46

标签: java sockets datagram

我收到后可以将DatagramPacket转换为int吗?

我收到的就像这样

DatagramSocket aSocket = null;

    try 
    {
        aSocket = new DatagramSocket(6789);

        byte [] buffer = new byte [1000];

        while (true)
        {
            DatagramPacket request = new DatagramPacket(buffer, buffer.length);
            aSocket.receive(request);
        }

0 个答案:

没有答案