comparison src/org/eclipse/jetty/io/ByteArrayBuffer.java @ 1038:b71ad168fe34

rename Buffer.length() to remaining()
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 03 Nov 2016 22:16:11 -0600
parents 80cad9086593
children a7319f14ba1e
comparison
equal deleted inserted replaced
1037:3c4c7cc7904f 1038:b71ad168fe34
116 116
117 117
118 Buffer b = (Buffer) obj; 118 Buffer b = (Buffer) obj;
119 119
120 // reject different lengths 120 // reject different lengths
121 if (b.length() != length()) 121 if (b.remaining() != remaining())
122 return false; 122 return false;
123 123
124 // reject AbstractBuffer with different hash value 124 // reject AbstractBuffer with different hash value
125 if (_hash != 0 && obj instanceof AbstractBuffer) 125 if (_hash != 0 && obj instanceof AbstractBuffer)
126 { 126 {
218 throw new IllegalStateException(__READONLY); 218 throw new IllegalStateException(__READONLY);
219 if (index < 0) 219 if (index < 0)
220 throw new IllegalArgumentException("index<0: " + index + "<0"); 220 throw new IllegalArgumentException("index<0: " + index + "<0");
221 */ 221 */
222 222
223 int length=src.length(); 223 int length=src.remaining();
224 if (index + length > capacity()) 224 if (index + length > capacity())
225 { 225 {
226 length=capacity()-index; 226 length=capacity()-index;
227 /* 227 /*
228 if (length<0) 228 if (length<0)