comparison src/org/eclipse/jetty/io/JBuffer.java @ 1065:158d1e6ac17f

fix JBuffer.compact()
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 09 Nov 2016 04:36:05 -0700
parents a0abb16cf6e7
children bbbda7c6e8ec
comparison
equal deleted inserted replaced
1064:a0abb16cf6e7 1065:158d1e6ac17f
66 public void get(byte[] bytes) { 66 public void get(byte[] bytes) {
67 bb.get(bytes); 67 bb.get(bytes);
68 } 68 }
69 69
70 public void compact() { 70 public void compact() {
71 int n = bb.remaining();
72 bb.compact(); 71 bb.compact();
73 bb.position(0);
74 bb.limit(n);
75 } 72 }
76 73
77 public int capacity() { 74 public int capacity() {
78 return bb.capacity(); 75 return bb.capacity();
79 } 76 }
82 79
83 public ByteBuffer getByteBuffer() { 80 public ByteBuffer getByteBuffer() {
84 return bb; 81 return bb;
85 } 82 }
86 83
87 public void clear() { 84 public void clearJ() {
88 bb.position(0); 85 bb.position(0);
89 bb.limit(0); 86 bb.limit(0);
90 } 87 }
91 88
92 public int space() { 89 public int space() {