Motorola HANDSET C381P User Manual
Page 33
8
Network APIs
33
try {
is[i] = hc[i].openInputStream();
byteCounts[i] = 0;
readLengths[i] = hc[i].getLength();
System.out.println("readLengths = " +
readLengths[i]);
if (readLengths[i] == -1)
{
readLengths[i] = BUFFER_SIZE;
}
int bytes_read = 0;
int offset = 0;
int bytes_left = (int)readLengths[i];
do
{
bytes_read = is[i].read(buffer, offset,
bytes_left);
offset += bytes_read;
bytes_left -= bytes_read;
byteCounts[i] += bytes_read;
}
while (bytes_read > 0);
System.out.println("byte read = " +
byteCounts[i]);
} catch (Exception ex) {
System.out.println("Downloading Failed: "+
ex.getMessage());
numPassed = 0;
}
finally {
try {
is[i].close();
is[i] = null;
} catch (Exception ex) {}
}
}
/**
* close http connection
*/
if (hc[i] != null)
{
try {
hc[i].close();
- RAZR V3 (110 pages)
- C118 (60 pages)
- C330 (166 pages)
- C139 (26 pages)
- C139 (174 pages)
- T720i (112 pages)
- C380 (97 pages)
- C156 (106 pages)
- C350 (30 pages)
- C550 (110 pages)
- V80 (108 pages)
- C155 (120 pages)
- C650 (124 pages)
- E398 (120 pages)
- TimePort 280 (188 pages)
- C200 (96 pages)
- E365 (6 pages)
- W510 (115 pages)
- V60C (190 pages)
- ST 7760 (117 pages)
- CD 160 (56 pages)
- StarTac85 (76 pages)
- Bluetooth (84 pages)
- V8088 (59 pages)
- Series M (80 pages)
- C332 (86 pages)
- V2088 (80 pages)
- P8088 (84 pages)
- Talkabout 191 (100 pages)
- Timeport 260 (108 pages)
- M3288 (76 pages)
- Timeport 250 (128 pages)
- V51 (102 pages)
- Talkabout 189 (125 pages)
- C115 (82 pages)
- StarTac70 (80 pages)
- Talkabout 192 (100 pages)
- i2000 (58 pages)
- i2000 (122 pages)
- Talkabout 720i (85 pages)
- i1000 (80 pages)
- A780 (182 pages)
- BRUTE I686 (118 pages)
- DROID 2 (70 pages)
- 68000202951-A (2 pages)