>>>>> "John D. Mitchell" <[EMAIL PROTECTED]>:

> In general, with respect to dealing with HTTP in Java, rather than
> reading all of the related RFCs and trying to implement them
> yourself,

Hm... I'm not sure if I get your meaning here...?

Using URLConnection is definitely a step up from implementing HTTP
over naked sockets.

Or maybe you're referring to my manual construction of a
multipart/form-data body?  Being able to remove that code, would
definitely be a good thing.

> I strongly suggest that people use (and enhance!) an existing HTTP
> client package such as the open source HTTPClient,
> http://www.innovation.ch/java/HTTPClient/

I've encountered from time to time in www.google.com searches, but I
haven't given it a closer look.  I have preferred to stay within the
class libraries offered by JDK.

One reason to give it a try, is that HttpOutputStream seems to be able 
to write data directly to the network, if the other end is HTTP 1.1
capable. 

Right now I'm getting java.lang.OutOfMemory exceptions, when trying to 
write a 12MB file in an HTTP POST:

java.lang.OutOfMemoryError:
        at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java)
        at java.io.OutputStreamWriter.flushBuffer(OutputStreamWriter.java)
        at java.io.OutputStreamWriter.flush(OutputStreamWriter.java)
        at java.io.BufferedWriter.flush(BufferedWriter.java)
        at java.io.PrintWriter.newLine(PrintWriter.java)
        at java.io.PrintWriter.println(PrintWriter.java)
        at RepositoryCmd.send(RepositoryCmd.java:72)
        at Upload.main(Upload.java:32)

I'm guessing that the culprit here, is the ByteArrayOutputStream.
However, why it should crash at a mere 12MB is beyond me.  According
to top it gives up way before it can make a serious impact on the
available swap space?

Is there some command line argument I have to give to the java
runtime, I wonder?


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to