comparison src/org/eclipse/jetty/io/ByteArrayBuffer.java @ 1044:dd71a59fcf72

remove buffer marking
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 04 Nov 2016 02:26:54 -0600
parents a7319f14ba1e
children
comparison
equal deleted inserted replaced
1043:ae1c92957739 1044:dd71a59fcf72
85 @Override 85 @Override
86 public final void compact() 86 public final void compact()
87 { 87 {
88 if (isReadOnly()) 88 if (isReadOnly())
89 throw new IllegalStateException(__READONLY); 89 throw new IllegalStateException(__READONLY);
90 int s = markIndex() >= 0 ? markIndex() : getIndex(); 90 int s = getIndex();
91 if (s > 0) 91 if (s > 0)
92 { 92 {
93 int length = putIndex() - s; 93 int length = putIndex() - s;
94 if (length > 0) 94 if (length > 0)
95 { 95 {
96 System.arraycopy(_bytes, s,_bytes, 0, length); 96 System.arraycopy(_bytes, s,_bytes, 0, length);
97 } 97 }
98 if (markIndex() > 0) setMarkIndex(markIndex() - s);
99 setGetIndex(getIndex() - s); 98 setGetIndex(getIndex() - s);
100 setPutIndex(putIndex() - s); 99 setPutIndex(putIndex() - s);
101 } 100 }
102 } 101 }
103 102