Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] ByteBuffers and Jetty?

I believe this is what you want...

http://docs.oracle.com/javaee/6/api/javax/servlet/ServletRequest.html#getInputStream()

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> wrote:
> Date: Tue, 1 May 2012 13:31:26 -0400
> From: Jeffrey Kesselman <jeffpk@xxxxxxxxx>

Thanks again for the replies, Jeff and Simone.

> WHat do you want access to?

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.

> 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
> request as binary block of data?

> If the latter you might want to consider using Netty instead.

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.

Thanks again,

Dave

_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-users



--
It's always darkest just before you are eaten by a grue.

Back to the top