> It must be something like this (untested):
>
[quoted text clipped - 6 lines]
> is.read(zipData, 0, f.length());
> is.close();
When you need to read a specific amount of bytes, you always need to
do it in a loop because read() does not need to read the full amount
that you're asking it, i.e., something like
// error and EOF handling omitted
int len = f.length();
int offset = 0;
while (len > 0) {
int n = is.read(zipData, offset, len);
offset += n;
len -= n;
}

Signature
Jaakko Kangasharju, Helsinki Institute for Information Technology
This space unintentionally left blank
Babu Kalakrishnan - 30 Aug 2006 08:03 GMT
>>It must be something like this (untested):
>>
[quoted text clipped - 19 lines]
> len -= n;
> }
Alternately, if you're dealing with disk files only, one could create a
RandomAccessFile object and use its readFully() method. For other types
of streams, you can use the same method after wrapping the stream into a
DataInputStream.
BK