Skip to content

Commit

Permalink
Delegate readString in FilterStreamInput to possibly use an optimized…
Browse files Browse the repository at this point in the history
… readString of the delegate. (elastic#105712)

This is necessary so that the optimized `readString` added in
elastic#104692 is actually used
when wrapped in a `FilterStreamInput`.
  • Loading branch information
mosche authored Feb 21, 2024
1 parent ce8402f commit a9f4b64
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ protected FilterStreamInput(StreamInput delegate) {
this.delegate = delegate;
}

@Override
public String readString() throws IOException {
return delegate.readString();
}

@Override
public byte readByte() throws IOException {
return delegate.readByte();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ public long getChecksum() {
return this.digest.getValue();
}

@Override
public String readString() throws IOException {
return doReadString(readArraySize()); // always use the unoptimized slow path
}

@Override
public byte readByte() throws IOException {
final byte b = delegate.readByte();
Expand Down

0 comments on commit a9f4b64

Please sign in to comment.