()
| 49 | } |
| 50 | |
| 51 | public CharBuffer compact() { |
| 52 | int remaining = remaining(); |
| 53 | |
| 54 | if (position != 0) { |
| 55 | CharBuffer b = slice(); |
| 56 | position = 0; |
| 57 | put(b); |
| 58 | } |
| 59 | |
| 60 | position = remaining; |
| 61 | limit(capacity()); |
| 62 | |
| 63 | return this; |
| 64 | } |
| 65 | |
| 66 | public CharBuffer put(CharBuffer src) { |
| 67 | if (src.hasArray()) { |