@Override public int available() { return AbstractIoBuffer.this.remaining(); }
@Override public int available() { return AbstractIoBuffer.this.remaining(); }
@Override public int available() { return AbstractIoBuffer.this.remaining(); }
@Override public int read(byte[] b, int off, int len) { int remaining = AbstractIoBuffer.this.remaining(); if (remaining > 0) { int readBytes = Math.min(remaining, len); AbstractIoBuffer.this.get(b, off, readBytes); return readBytes; } return -1; }
@Override public int read(byte[] b, int off, int len) { int remaining = AbstractIoBuffer.this.remaining(); if (remaining > 0) { int readBytes = Math.min(remaining, len); AbstractIoBuffer.this.get(b, off, readBytes); return readBytes; } return -1; }
@Override public int read(byte[] b, int off, int len) { int remaining = AbstractIoBuffer.this.remaining(); if (remaining > 0) { int readBytes = Math.min(remaining, len); AbstractIoBuffer.this.get(b, off, readBytes); return readBytes; } return -1; }
/** * {@inheritDoc} */ @Override public final IoBuffer sweep() { clear(); return fillAndReset(remaining()); }
/** * {@inheritDoc} */ @Override public final IoBuffer sweep(byte value) { clear(); return fillAndReset(value, remaining()); }
/** * {@inheritDoc} */ @Override public final IoBuffer sweep() { clear(); return fillAndReset(remaining()); }
/** * {@inheritDoc} */ @Override public final IoBuffer sweep(byte value) { clear(); return fillAndReset(value, remaining()); }
/** * {@inheritDoc} */ @Override public final IoBuffer sweep() { clear(); return fillAndReset(remaining()); }
/** * {@inheritDoc} */ @Override public final IoBuffer sweep(byte value) { clear(); return fillAndReset(value, remaining()); }
/** * {@inheritDoc} */ @Override public int compareTo(IoBuffer that) { int n = this.position() + Math.min(this.remaining(), that.remaining()); for (int i = this.position(), j = that.position(); i < n; i++, j++) { byte v1 = this.get(i); byte v2 = that.get(j); if (v1 == v2) { continue; } if (v1 < v2) { return -1; } return +1; } return this.remaining() - that.remaining(); }
/** * {@inheritDoc} */ public int compareTo(IoBuffer that) { int n = this.position() + Math.min(this.remaining(), that.remaining()); for (int i = this.position(), j = that.position(); i < n; i++, j++) { byte v1 = this.get(i); byte v2 = that.get(j); if (v1 == v2) { continue; } if (v1 < v2) { return -1; } return +1; } return this.remaining() - that.remaining(); }
/** * {@inheritDoc} */ @Override public int compareTo(IoBuffer that) { int n = this.position() + Math.min(this.remaining(), that.remaining()); for (int i = this.position(), j = that.position(); i < n; i++, j++) { byte v1 = this.get(i); byte v2 = that.get(j); if (v1 == v2) { continue; } if (v1 < v2) { return -1; } return +1; } return this.remaining() - that.remaining(); }
/** * {@inheritDoc} */ @Override public boolean equals(Object o) { if (!(o instanceof IoBuffer)) { return false; } IoBuffer that = (IoBuffer) o; if (this.remaining() != that.remaining()) { return false; } int p = this.position(); for (int i = this.limit() - 1, j = that.limit() - 1; i >= p; i--, j--) { byte v1 = this.get(i); byte v2 = that.get(j); if (v1 != v2) { return false; } } return true; }
/** * {@inheritDoc} */ @Override public boolean equals(Object o) { if (!(o instanceof IoBuffer)) { return false; } IoBuffer that = (IoBuffer) o; if (this.remaining() != that.remaining()) { return false; } int p = this.position(); for (int i = this.limit() - 1, j = that.limit() - 1; i >= p; i--, j--) { byte v1 = this.get(i); byte v2 = that.get(j); if (v1 != v2) { return false; } } return true; }