You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Twan <tw...@sensualdirectory.com> on 2007/05/15 16:15:43 UTC
Transfer large files?
Hello,
I'm developing a client and server where the client retrieves
information from a server. This information is retrieved by sending
text queries to the server and the server returns a the information
(text format). For this i am using the TextLineCodecFactory which works great.
But at a certain point i have to transfer a large binary file (about
10mb) to the client. One method i came up with is to put the large in
a java object and use ObjectSerializationCodecFactory. But the
problem with this solution that i have to load the 10mb file into
memory on the server.
I rather read a couple bytes from a file that is on the server and
send it directly to the client. Can somebody please tell me which
combination of classes i should use to make this work?
Kind regards,
Twan
Re: Transfer large files?
Posted by Twan <tw...@sensualdirectory.com>.
Hi,
Thanks for the reply Pete.
StreamWriteFilter looks promising, i found the following mail in the archive:
http://www.mail-archive.com/mina-dev@directory.apache.org/msg01657.html
It even demonstrates on how to set it up in combination with the
TextLinkCodecFactory.
Archives are definately handy.
-twan
At 06:23 PM 5/15/2007, you wrote:
>On May 15, 2007, at 7:15 AM, Twan wrote:
>>I rather read a couple bytes from a file that is on the server and
>>send it directly to the client. Can somebody please tell me which
>>combination of classes i should use to make this work?
>
>Give the StreamWriteFilter a whirl.
>-pete
>
>
>--
>proyal@apache.org - http://fotap.org/~osi
>
>
>
>
>
Re: Transfer large files?
Posted by peter royal <pr...@apache.org>.
On May 15, 2007, at 7:15 AM, Twan wrote:
> I rather read a couple bytes from a file that is on the server and
> send it directly to the client. Can somebody please tell me which
> combination of classes i should use to make this work?
Give the StreamWriteFilter a whirl.
-pete
--
proyal@apache.org - http://fotap.org/~osi