Hello Martin,

class MyInputStream extends FilterInputStream
{
int counter = 0
int getCounter() // return counter
...
int read() // read and increment counter by one
int read(byte[]) // read an increment counter by return value
int read(byte[], int, int) // read an increment counter by return value
}

// in the applet
MyInputStream mis = new MyInputStream(fin)
put.setRequestBody(mis)

// while method executes, use mis.getCounter()
// from a different thread

hope that helps,
  Roland






"martin hilpert" <[EMAIL PROTECTED]>
17.03.2004 14:35
Please respond to "Commons HttpClient Project"
 
        To:     "Commons HttpClient Project" 
<[EMAIL PROTECTED]>
        cc: 
        Subject:        Re: OutOfMemory if using PUT


Hi,
yes i heard about that class.
no i dont use any swing control,
i use awt.


> Errm... Ever heard of the java.io.FilterInputStream class? It is 
> intended to be a base class for such a thing linke you need. If you are 
> using Swing you can just use javax.swing.ProgressMonitorInputStream.
i dont understand how i can monitor the stream.

HttpClient client = new HttpClient();
PutMethod put = new PutMethod(zielurl);
FileInputStream fin =new FileInputStream("C:\test.jpg");
put.setRequestBody(fin);
put.setRequestContentLength(PutMethod.CONTENT_LENGTH_CHUNKED);
client.executeMethod(put);
System.out.print(put.getResponseBodyAsString());
put.releaseConnection();




---------------------------------------------------------------------
To unsubscribe, e-mail: 
[EMAIL PROTECTED]
For additional commands, e-mail: 
[EMAIL PROTECTED]


Reply via email to