comparison src/org/eclipse/jetty/io/nio/DirectNIOBuffer.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
comparison
equal deleted inserted replaced
1037:3c4c7cc7904f 1038:b71ad168fe34
119 if (isReadOnly()) throw new IllegalStateException(__READONLY); 119 if (isReadOnly()) throw new IllegalStateException(__READONLY);
120 120
121 byte[] array=src.array(); 121 byte[] array=src.array();
122 if (array!=null) 122 if (array!=null)
123 { 123 {
124 return poke(index,array,src.getIndex(),src.length()); 124 return poke(index,array,src.getIndex(),src.remaining());
125 } 125 }
126 else 126 else
127 { 127 {
128 Buffer src_buf=src.buffer(); 128 Buffer src_buf=src.buffer();
129 if (src_buf instanceof DirectNIOBuffer) 129 if (src_buf instanceof DirectNIOBuffer)
134 try 134 try
135 { 135 {
136 _buf.position(index); 136 _buf.position(index);
137 int space = _buf.remaining(); 137 int space = _buf.remaining();
138 138
139 int length=src.length(); 139 int length=src.remaining();
140 if (length>space) 140 if (length>space)
141 length=space; 141 length=space;
142 142
143 src_bytebuf.position(src.getIndex()); 143 src_bytebuf.position(src.getIndex());
144 src_bytebuf.limit(src.getIndex()+length); 144 src_bytebuf.limit(src.getIndex()+length);