comparison src/org/eclipse/jetty/server/Connector.java @ 1046:a8c92b0a08ed

add JBuffer
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 07 Nov 2016 22:39:39 -0700
parents 8c13b9224cff
children 1accf965d51a
comparison
equal deleted inserted replaced
1045:48506d03e230 1046:a8c92b0a08ed
28 28
29 import javax.servlet.ServletRequest; 29 import javax.servlet.ServletRequest;
30 30
31 import org.eclipse.jetty.io.Buffer; 31 import org.eclipse.jetty.io.Buffer;
32 import org.eclipse.jetty.io.Buffers; 32 import org.eclipse.jetty.io.Buffers;
33 import org.eclipse.jetty.io.BufferUtil;
33 import org.eclipse.jetty.io.EndPoint; 34 import org.eclipse.jetty.io.EndPoint;
34 import org.eclipse.jetty.io.EofException; 35 import org.eclipse.jetty.io.EofException;
35 import org.eclipse.jetty.io.nio.DirectNIOBuffer; 36 import org.eclipse.jetty.io.nio.DirectNIOBuffer;
36 import org.eclipse.jetty.io.nio.IndirectNIOBuffer; 37 import org.eclipse.jetty.io.nio.IndirectNIOBuffer;
37 import org.eclipse.jetty.util.component.AggregateLifeCycle; 38 import org.eclipse.jetty.util.component.AggregateLifeCycle;
251 252
252 253
253 // my own buffers 254 // my own buffers
254 255
255 protected Buffer newBuffer(int size) { 256 protected Buffer newBuffer(int size) {
256 return new DirectNIOBuffer(size); 257 // return new DirectNIOBuffer(size);
258 return BufferUtil.newDirectBuffer(size);
257 } 259 }
258 260
259 private class MyBuffers implements Buffers { 261 private class MyBuffers implements Buffers {
260 private final int headerSize; 262 private final int headerSize;
261 private final int bufferSize; 263 private final int bufferSize;
265 this.bufferSize = bufferSize; 267 this.bufferSize = bufferSize;
266 } 268 }
267 269
268 @Override 270 @Override
269 public Buffer getHeader() { 271 public Buffer getHeader() {
270 return new IndirectNIOBuffer(headerSize); 272 // return new IndirectNIOBuffer(headerSize);
273 return BufferUtil.newBuffer(headerSize);
271 } 274 }
272 275
273 @Override 276 @Override
274 public Buffer getBuffer() { 277 public Buffer getBuffer() {
275 return newBuffer(bufferSize); 278 return newBuffer(bufferSize);