Get array from socket
<p>I'm finding a way to get an array, each component can have value between 0 and 255.
I'm using Android Studio and I received data from a socket. The following is my code.</p>

<pre><code>try {
            InetAddress IpAddress = InetAddress.getByName(remoteName);
            myUpd_socket = new DatagramSocket(remotePort);
            // Send connect message
            String str = "connect request";
            send_data = str.getBytes();
            DatagramPacket send_packet = new DatagramPacket(send_data,str.length(), IpAddress, remotePort);
            myUpd_socket.send(send_packet);
            byte[] dataArray = new byte[1024];
            DatagramPacket udp_packet = new DatagramPacket(dataArray,dataArray.length);

            while (true) {
                myUpd_socket.receive(udp_packet);
                byte[] buff = new byte[udp_packet.getLength()];
                System.arraycopy(dataArray,0,buff,0,buff.length);
            }

        } catch (SocketException e) {
            e.printStackTrace();
        } catch (UnknownHostException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
</code></pre>

<p>I need to get the same data from the transmitter. There is no negative value in original data. But when I checked the received data, the buff has a lot of negative values. I made something wrong here.
I'm a newbie of Java and android. So I'm really grateful if someone can help me.
Thank.</p>