JoeHF commented on code in PR #1003: URL: https://github.com/apache/lucene/pull/1003#discussion_r921030029
########## lucene/core/src/java/org/apache/lucene/codecs/compressing/Decompressor.java: ########## @@ -42,6 +44,13 @@ protected Decompressor() {} public abstract void decompress( DataInput in, int originalLength, int offset, int length, BytesRef bytes) throws IOException; + public InputStream decompress(DataInput in, int originalLength, int offset, int length) Review Comment: I tried returning `DataInput` instead of `InputStream` for `decompressor`. However, i found it really hard to achieve the function when slicing. In slicing mode, there is a need to know we have run out of current slice and need to decompress the next slice(within `Lucene90CompressingStoredFieldsReader`). `InputStream` provide more friendly api that help us check we have reached the end of one slice. `read()` returning -1 and `read(byte b[], int off, int len)` returning length that is less than params `len` both indicate us to decompress next slice while `DataInput` can not. Meanwhile, `Decompressor` has no visibility of slice. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org