[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [jetty-users] ByteBuffers and Jetty?
- From: Jeffrey Kesselman <jeffpk@xxxxxxxxx>
- Date: Thu, 3 May 2012 17:56:09 -0400
- Delivered-to: email@example.com
I believe this is what you want...
I do not believe there is any way to get Jetty to put the data read in into a ByteBuffer of your own choosing. The reading happens deep in Jetty and what you get is an HttpServletRequest that already contains the data in Java heap.
Logically, even if you could pass jetty a native byte buffer to fill it would likely have to read the data from the Java heap its own layers to fill it.
Memory mapped files, if Jettey allows for it, is likely the most direct way to move the data in and out. have your C code read or write from files and have jetty also read and write to them.
On Thu, May 3, 2012 at 4:57 PM, David Walend <david@xxxxxxxxxx>
> Date: Tue, 1 May 2012 13:31:26 -0400
> From: Jeffrey Kesselman <jeffpk@xxxxxxxxx>
Thanks again for the replies, Jeff and Simone.
Ultimately, big contiguous blocks of code in C memory. In a later phase I need to tie a large piece of mathematical analysis code on the clients to an even larger piece of mathematical analysis code in the server. I'd like to tap the C memory via direct ByteBuffers to avoid copying data through Java.
> WHat do you want access to?
> Are you trying to get a block of binary data that was sent as a post
> pameter, like in a file upload? or are you trying to get the entire http> If the latter you might want to consider using Netty instead.
> request as binary block of data?
I'm interested in the former. I'd like to use http requests and replies to move the data around on the wire, and use other servlets to build up less complicated (and differently complicated) parts of the system behind a single front-end. I think with Netty I'd have the power to solve the hardest problems I'll face, but would make all the easy problems similarly hard to solve.
It's always darkest just before you are eaten by a grue.