Hi all! I use BufferedInputStream in my code:

socket = new Socket(ip, Integer.parseInt(port));
socket.setReceiveBufferSize(64000);
output = socket.getOutputStream();
input =  new BufferedInputStream(socket.getInputStream(), 64000);

I read incoming packets like this:

if (input.available() != 0)  {
                        System.out.println("Get Packet: " +
input.available() + " bytes");
                        byte[] b = new byte[input.available()];
                        input.read(b);
                        incParser(b);
}

I always get 2048 bytes in input(though it comes more) and the data
left loses. How can I set buffer size of BufferedInputStream more than
2048 bytes?
P.S.
This code works on Desktop as well, i can receive packets bigger than
2048 bytes.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to