At 01:45 PM 10/19/99 -0700, Ruslan Belkin wrote:
>Bina Keshava wrote:
>
>> I am using Netscape enterprise 4. When trying to upload a binary file
>> I get the following exception :
>>
>
>I have no clue what is servlet doing - you've the stack trace. It's not
the servlet
>the web server who's throwning the exception,
>
There is a bug in jsdk's readLine() method (it was ignoring len):
public int readLine(byte[] b, int off, int len) throws IOException {
if (len <= 0) {
return 0;
}
int count = 0, c;
while ((c = read()) != -1) {
b[off++] = (byte)c;
count++;
if (c == '\n') {
break;
}
}
return count > 0 ? count : -1;
}
It is fixed in the 2.1 :
public int readLine(byte[] b, int off, int len) throws IOException {
if (len <= 0) {
return 0;
}
int count = 0, c;
while ((c = read()) != -1) {
b[off++] = (byte)c;
count++;
if (c == '\n' || count == len) {
break;
}
}
return count > 0 ? count : -1;
}
Regards
Dimitri
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html