This question has been asked a couple of times before, but there doesn't appear to be a complete answer yet, so I'm going to ask again. Here are the references to the previous questions:
http://forum.springframework.org/viewtopic.php?t=1179
http://forum.springframework.org/viewtopic.php?t=1186
The Hessian code examples included in those two posts appear to be adapted from the code snippet on the Caucho Hessian web site:
http://www.caucho.com/resin-3.0/prot...ge-binary-data
The idea being that if you're transfering a large amount of data between client/server in a Hessian call, you're better off handling the data transfer yourself with streams, rather than allowing Hessian to buffer the big file in memory before it handles the transfer for you.
I am trying to implement this very thing: big file upload/download.
But, I can't figure out how to use the Spring wrappers around the Hessian classes in order to gain access to the HessianInput and HessianOutput streams I need. Here's the example code snippet from the last URL I listed above:
OutputStream os = conn.getOutputStream();
HessianOutput out = new HessianOutput(os);
out.startCall("download");
out.writeString("my-file.txt");
out.completeCall();
InputStream is = conn.getInputStream();
HessianInput in = new HessianInput(is);
in.startReply();
InputStream is = in.readInputStream();
... // save the input stream data somewhere
in.completeReply();
Thanks!
Peter


Reply With Quote