Hi,
I have to read a ServletInputStream more than one time. But how can I do this? I first tried to use mark() and reset() but that doesn't work. After that I tried to copy the InputStream into a byte[] with:
byte[] inByte = new byte[request.getContentLength()];
InputStream sin = request.getInputStream();
sin.read(inByte);
...
InputStream in = new ByteArrayInputStream(inByte);
But if the InputStream of the request is too big, I could not read the whole stream (and the sin.available doesn't because its always 0).
Is there perhaps a class available where I can put my InputStream without parsing every single byte to a byte[] ?