Skip to content

Commit 84b5a55

Browse files
committed
more
1 parent fdb7d31 commit 84b5a55

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

server/src/main/java/org/elasticsearch/common/io/stream/RecyclerBytesStreamOutput.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,16 @@ public void writeByte(byte b) {
7373
++currentPageOffset;
7474
}
7575

76+
@Override
77+
public void write(byte[] b) throws IOException {
78+
writeBytes(b, 0, b.length);
79+
}
80+
81+
@Override
82+
public void write(byte[] b, int off, int len) throws IOException {
83+
writeBytes(b, off, len);
84+
}
85+
7686
@Override
7787
public void writeBytes(byte[] b, int offset, int length) {
7888
// nothing to copy
@@ -301,8 +311,8 @@ public ReleasableBytesReference moveToBytesReference() {
301311
var bytes = bytes();
302312
var pages = this.pages;
303313
this.pages = null;
304-
305314
this.bytesRefBytes = null;
315+
306316
return new ReleasableBytesReference(bytes, () -> Releasables.close(pages));
307317
}
308318

0 commit comments

Comments
 (0)