private void remove(byte[] buf, int pos, int len) { if (len == 0) { return; } if (len < 0) { throw new AssertionError(); } System.arraycopy(rBuf, rBufPos, buf, pos, len); rBufPos = clip(rBufPos + len); rBufUsed -= len; }
private void append(byte[] buf, int pos, int len) { if (len == 0) { return; } if (len < 0) { throw new AssertionError(); } int p = clip(rBufPos + rBufUsed); System.arraycopy(buf, pos, rBuf, p, len); rBufUsed += len; }
private void append(byte[] buf, int pos, int len) { if (len == 0) { return; } if (len < 0) { throw new AssertionError(); } int p = clip(rBufPos + rBufUsed); System.arraycopy(buf, pos, rBuf, p, len); rBufUsed += len; }
private void remove(byte[] buf, int pos, int len) { if (len == 0) { return; } if (len < 0) { throw new AssertionError(); } System.arraycopy(rBuf, rBufPos, buf, pos, len); rBufPos = clip(rBufPos + len); rBufUsed -= len; }
/** * Discards the oldest <code>len</code> bytes within the ring buffer. This * has the same effect as calling <code>read(new byte[len], 0, len)</code>. * * @param len The number of bytes to be discarded. */ public void discard(int len) { if (len < 0) { throw new IllegalArgumentException(); } int trLen = Math.min(len, rBufUsed); rBufPos = clip(rBufPos + trLen); rBufUsed -= trLen; }
/** * Discards the oldest <code>len</code> bytes within the ring buffer. This * has the same effect as calling <code>read(new byte[len], 0, len)</code>. * * @param len The number of bytes to be discarded. */ public void discard(int len) { if (len < 0) { throw new IllegalArgumentException(); } int trLen = Math.min(len, rBufUsed); rBufPos = clip(rBufPos + trLen); rBufUsed -= trLen; }