Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Efficiently using readonly java.nio.ByteBuffer with HttpExchange.setRequestContent?

In my application I have a java.nio.ByteBuffer which is non-direct and which is
readonly, and I'd like to send its contents as the request content of an
HttpExchange. 

I tried creating a Jetty IndirectNIOBuffer around the NIO buffer but get a
ReadOnlyBufferException since the constructor for IndirectNIOBuffer attempts to
access the underlying byte[] array.

Is there some other way to get a Jetty Buffer that I can pass to
HttpExchange.setRequestContent but which won't require me to make a copy?

jonathan


Back to the top