Oh right.  There's no IoSession.sendFile.  Sorry for the mistake! :)

The correct answer is: you can simply write a file by writing JDK File,
FileChannel and MINA FileRegion.

Niklas Therning wrote:
> 
> 1) AFAICS there's no IoSession.sendFile(). I think you mean calling
> IoSession.write() with a File or FileChannel object?
> 2) This is exactly what StreamWriteFilter and FileRegionWriteFilter do.
> Once installed you can just call IoSession.write() with an InputStream
> object or FileRegion object.
> 
> Option 1 is probaby the most performant one. However, I dont think
> option 1 will work if you need to process the file data through some
> other filter before it's written (e.g. SslFilter). In that case you
> shouold go with option 2.
> 
> /Niklas
> 
> "이희승 (Trustin Lee) <[EMAIL PROTECTED]>" skrev:
>> Hi Pat,
>>
>> 1) Use IoSession.sendFile()
>> 2) Split the file into multiple 64kb (or bigger) chunks and send them
>> one by one using WriteFuture.addListener() or messageSent().
>>
>> HTH,
>>
>> Pat C wrote:
>>  
>>> Hi,
>>>
>>> We would like to write a client-server that can send and accept (binary)
>>> attachments. We would like to upload file of sizes from 500KB to 25 MB.
>>>
>>> Can someone guide me on the right approach you have taken with any
>>> references to some example code.
>>>
>>> Thanks in advance,
>>> Pat
>>>
>>>     
>>
>>   
> 

-- 
Trustin Lee - Principal Software Engineer, JBoss, Red Hat
--
what we call human nature is actually human habit
--
http://gleamynode.net/

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to