Hi

I am doing a project using java Avetana Bluetooth and Belkin class 1 Bluetooth dongle to send files from PC to handphone via OBEX. I am successful at this but to me, I think the transfer speed is too slow (40kb per 4 sec... making it actually 10 kbps).

I try it out with Windows by right-click Send To via Bluetooth, and to my surprise, the speed is very fast. (40kbps).

Does anyone know's how to achieve this much speed by using java? Currently my codings for the transfer part is as follows. I have tried DataOutputStream, FileOutputStream, OBEX Push, OBEX File Transfer but the outcome is still as slow.


Operation op = conn.put(header);
OutputStream os = op.openOutputStream();
InputStream is = new FileInputStream(file);
byte b[] = new byte[4000]; // changing the value here won't speed up too
int r;
int times=1;
while((r = is.read(b)) > 0)
{
os.write(b, 0, r);
}


Thanks in advance!