I'm using sockets for data transfer from one android phone and PC, it is 
taking 15 seconds to read about 1 Mb of data. I want to improve its 
performance.

Could anyone suggest any better way to do that?

My Code is:

InputStream is= socket.getInputStream();
DataInputStream inChannel= new DataInputStream(new BufferedInputStream(in));
ByteArrayOutputStream baos = new ByteArrayOutputStream();
int oneByte;
while ((oneByte = inChannel.read()) != -1) {
            if (oneByte == 0) {
                break;
            }         
            baos.write(oneByte);
            byteCount++;
        }
byte[] inData = baos.toByteArray();
baos.close();

-- 
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