I created a aroundReadFrom interceptor and deployed on the client-side:
ric.setInputStream(new FilterInputStream(ric.getInputStream()) {
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
@Override
public int read() throws IOException {
System.out.println("read");
return super.read();
}
@Override
public int read(byte[] b) throws IOException {
System.out.println("read(byte[]");
return super.read(b);
}
@Override
public int read(byte[] b, int off, int len) throws
IOException {
System.out.println("read(byte[], int, int)");
baos.write(b, off, len);
return super.read(b, off, len);
}
@Override
public void close() throws IOException {
System.out.println("### " + baos.toString());
super.close();
}
});
A POST request invokes only the read(byte[], int, int) method and close
is never called.
Is that the expected behavior ?
Arun
--
http://twitter.com/arungupta
http://blogs.oracle.com/arungupta