@Override public void reset() { final ByteArray prevBytes = this.bytes; super.reset(); if (prevBytes != this.bytes) { // re-create the releasable with the new reference releasable = Releasables.releaseOnce(this.bytes); } } }
/** * A channel level bytes output that can be reused. The bytes output is lazily instantiated * by a call to {@link #newBytesOutput()}. Once the stream is created, it gets reset on each * call to this method. */ @Override public final BytesStreamOutput bytesOutput() { if (bytesOut == null) { bytesOut = newBytesOutput(); } else { bytesOut.reset(); } return bytesOut; }
@Override public void reset() { final ByteArray prevBytes = this.bytes; super.reset(); if (prevBytes != this.bytes) { // re-create the releasable with the new reference releasable = Releasables.releaseOnce(this.bytes); } } }
@Override public void reset() { final ByteArray prevBytes = this.bytes; super.reset(); if (prevBytes != this.bytes) { // re-create the releasable with the new reference releasable = Releasables.releaseOnce(this.bytes); } } }
/** * A channel level bytes output that can be reused. It gets reset on each call to this * method. */ @Override public final BytesStreamOutput bytesOutput() { if (bytesOut == null) { bytesOut = newBytesOutput(); } else { bytesOut.reset(); } return bytesOut; }
@Override public void reset() { final ByteArray prevBytes = this.bytes; super.reset(); if (prevBytes != this.bytes) { // re-create the releasable with the new reference releasable = Releasables.releaseOnce(this.bytes); } } }
/** * A channel level bytes output that can be reused. The bytes output is lazily instantiated * by a call to {@link #newBytesOutput()}. Once the stream is created, it gets reset on each * call to this method. */ @Override public final BytesStreamOutput bytesOutput() { if (bytesOut == null) { bytesOut = newBytesOutput(); } else { bytesOut.reset(); } return bytesOut; }
/** * A channel level bytes output that can be reused. The bytes output is lazily instantiated * by a call to {@link #newBytesOutput()}. Once the stream is created, it gets reset on each * call to this method. */ @Override public final BytesStreamOutput bytesOutput() { if (bytesOut == null) { bytesOut = newBytesOutput(); } else { bytesOut.reset(); } return bytesOut; }
/** * A channel level bytes output that can be reused. The bytes output is lazily instantiated * by a call to {@link #newBytesOutput()}. Once the stream is created, it gets reset on each * call to this method. */ @Override public final BytesStreamOutput bytesOutput() { if (bytesOut == null) { bytesOut = newBytesOutput(); } else { bytesOut.reset(); } return bytesOut; }