Method m = mi.getMethod();
String methodName = m.getName();
if (methodName.equals("setAsciiStream") ||
methodName.equals("setBinaryStream"))
{
Object[] args = mi.getArguments();
InputStream ins = (InputStream) args[1];
args[1] = new SerializableInputStream(ins);
}
else if (methodName.equals("setCharacterStream"))
{
Object[] args = mi.getArguments();
Reader rdr = (Reader) args[1];
args[1] = new SerializableReader(rdr);
}
return getNext().invoke(mi);