now knows that it has a BufferedInputStream to be able to support inputstream.mark()

This commit is contained in:
hns 2001-01-24 14:29:52 +00:00
parent d7efbb9e32
commit f7bc885823

View file

@ -1,7 +1,6 @@
package helma.xmlrpc; package helma.xmlrpc;
import java.io.InputStream; import java.io.*;
import java.io.IOException;
// This class is borrowed from Apache JServ // This class is borrowed from Apache JServ
class ServerInputStream extends InputStream { class ServerInputStream extends InputStream {
@ -11,10 +10,11 @@ class ServerInputStream extends InputStream {
// data POSTed was read. If this is left to -1, content length is // data POSTed was read. If this is left to -1, content length is
// assumed as unknown and the standard InputStream methods will be used // assumed as unknown and the standard InputStream methods will be used
long available = -1; long available = -1;
long markedAvailable;
private InputStream in; private BufferedInputStream in;
public ServerInputStream(InputStream in, int available) { public ServerInputStream(BufferedInputStream in, int available) {
this.in = in; this.in = in;
this.available = available; this.available = available;
} }
@ -57,5 +57,18 @@ class ServerInputStream extends InputStream {
return skip; return skip;
} }
public void mark (int readlimit) {
in.mark (readlimit);
markedAvailable = available;
}
public void reset () throws IOException {
in.reset ();
available = markedAvailable;
}
public boolean markSupported () {
return true;
}
} }