Lines Matching refs:buf
92 ByteBuffer buf = buffers[start];
93 if (buf.capacity() < size) {
94 buf = null;
101 buf = bb;
105 if (buf == null)
117 buf.rewind();
118 buf.limit(size);
119 return buf;
122 boolean offerFirst(ByteBuffer buf) {
127 buffers[start] = buf;
133 boolean offerLast(ByteBuffer buf) {
138 buffers[next] = buf;
150 ByteBuffer buf = buffers[start];
154 return buf;
163 ByteBuffer buf = cache.get(size);
164 if (buf != null) {
165 return buf;
171 buf = cache.removeFirst();
172 free(buf);
181 static void releaseTemporaryDirectBuffer(ByteBuffer buf) {
182 offerFirstTemporaryDirectBuffer(buf);
190 static void offerFirstTemporaryDirectBuffer(ByteBuffer buf) {
191 assert buf != null;
193 if (!cache.offerFirst(buf)) {
195 free(buf);
205 static void offerLastTemporaryDirectBuffer(ByteBuffer buf) {
206 assert buf != null;
208 if (!cache.offerLast(buf)) {
210 free(buf);
217 private static void free(ByteBuffer buf) {
218 ((DirectBuffer)buf).cleaner().clean();