comparison src/org/eclipse/jetty/io/BufferUtil.java @ 1068:9d357b9e4bcb

fix BufferUtil.newBuffer()
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 10 Nov 2016 00:23:05 -0700
parents bbbda7c6e8ec
children 6b7ff30bb990
comparison
equal deleted inserted replaced
1067:56b515be91e1 1068:9d357b9e4bcb
211 return new JBuffer(bb); 211 return new JBuffer(bb);
212 } 212 }
213 213
214 public static JBuffer newBuffer(int size) { 214 public static JBuffer newBuffer(int size) {
215 ByteBuffer bb = ByteBuffer.allocate(size); 215 ByteBuffer bb = ByteBuffer.allocate(size);
216 bb.limit(0);
217 return new JBuffer(bb); 216 return new JBuffer(bb);
218 } 217 }
219 218
220 public static JBuffer newDirectBuffer(int size) { 219 public static JBuffer newDirectBuffer(int size) {
221 ByteBuffer bb = ByteBuffer.allocateDirect(size); 220 ByteBuffer bb = ByteBuffer.allocateDirect(size);
222 bb.limit(0);
223 return new JBuffer(bb); 221 return new JBuffer(bb);
224 } 222 }
225 223
226 224
227 225