[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: firstname.lastname@example.org
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=cSRy4SPQWG+D+A2TLTwt9+TtQMUmiRS2KY7r9XEOE2w=; b=IIn0ps3+q8WWjgVYW2wf+eF1bvdMoj4vAMxeWfOO1iGd4H0ErblCQTmpzFjs9CAXIZ VH4MOrVEYnFVMgF5D4je9zVunICXq2o4U27ErtA4j9KM2P/42jvQ8GbpKUCyzxiRK0yt yJ1fBPHQPP6tZ29PZXCVZMukd2fAtIIqcDvDZdAFRXK7V0eQ89TfDLNYVYbciAe0BXaf UEliT/aZlNBSEPXcTcOET55ia2h93+08deDOh5XCZ25BMarMLnkvfk6LvgEf08YnZCBe f0NVwmer/CVr3yBRglhb3ZMMXs/ltPEcdPEp3pl7z0hW2kJBjN89WgAtlDOdBJ++7Tf9 4W9A==
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.