Mercurial Hosting > luan
comparison src/org/eclipse/jetty/io/BufferUtil.java @ 1065:158d1e6ac17f
fix JBuffer.compact()
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 09 Nov 2016 04:36:05 -0700 |
parents | 013939bfc9e8 |
children | bbbda7c6e8ec |
comparison
equal
deleted
inserted
replaced
1064:a0abb16cf6e7 | 1065:158d1e6ac17f |
---|---|
236 public static String getString(JBuffer buffer) { | 236 public static String getString(JBuffer buffer) { |
237 byte[] bytes = new byte[buffer.remaining()]; | 237 byte[] bytes = new byte[buffer.remaining()]; |
238 buffer.get(bytes); | 238 buffer.get(bytes); |
239 return new String(bytes,ISO_8859_1); | 239 return new String(bytes,ISO_8859_1); |
240 } | 240 } |
241 | |
242 public static void compact(JBuffer buffer) { | |
243 buffer.compact(); | |
244 buffer.limit(buffer.position()); | |
245 buffer.position(0); | |
246 } | |
241 } | 247 } |