1 2 3 4 5 6 7 8 9 | public ByteBuffer put(byte x) { hb[ix(nextPutIndex())] = x; return this; } final int nextPutIndex() { if (position >= limit) throw new BufferOverflowException(); return position++; } |
1 2 3 4 5 6 7 8 | public byte get() { return hb[ix(nextGetIndex())]; } final int nextGetIndex() { if (position >= limit) throw new BufferUnderflowException(); return position++; } |
1 2 3 4 5 6 | public final Buffer flip() { limit = position; position = 0; mark = -1; return this; } |
1 2 3 4 | public final Buffer mark() { mark = position; return this; } |
1 2 3 4 5 6 7 | public final Buffer reset() { int m = mark; if (m < 0) throw new InvalidMarkException(); position = m; return this; } |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |