Re: [PR] Add GrowableByteArrayDataOutput [lucene]

2023-11-19 Thread via GitHub
dungba88 commented on PR #12824: URL: https://github.com/apache/lucene/pull/12824#issuecomment-1817963028 > it would be perhaps better to include this class where it's actually used so that the use context is clear That's a good idea. I'll close this > Arrays.copyOf is definit

Re: [PR] Add GrowableByteArrayDataOutput [lucene]

2023-11-19 Thread via GitHub
dungba88 closed pull request #12824: Add GrowableByteArrayDataOutput URL: https://github.com/apache/lucene/pull/12824 -- 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 unsubsc

Re: [PR] Add GrowableByteArrayDataOutput [lucene]

2023-11-19 Thread via GitHub
dweiss commented on PR #12824: URL: https://github.com/apache/lucene/pull/12824#issuecomment-1817936062 I don't see the whole picture of where you need it - it would be perhaps better to include this class where it's actually used so that the use context is clear. In general, the less code,

Re: [PR] Add GrowableByteArrayDataOutput [lucene]

2023-11-19 Thread via GitHub
dungba88 commented on PR #12824: URL: https://github.com/apache/lucene/pull/12824#issuecomment-1817868544 Unrelated but I once tried to call Arrays.copyOf on growing, which is the same method that BAOS used. However Lucene complained something about that method not perform well and redirect

Re: [PR] Add GrowableByteArrayDataOutput [lucene]

2023-11-19 Thread via GitHub
dungba88 commented on PR #12824: URL: https://github.com/apache/lucene/pull/12824#issuecomment-1817866406 Thanks, I think that would means we either subclass ByteArrayOutputStream or use a byte[] and do the grow ourselves. But most of the functionality in BAOS is private (such as grow and e

Re: [PR] Add GrowableByteArrayDataOutput [lucene]

2023-11-19 Thread via GitHub
dweiss commented on PR #12824: URL: https://github.com/apache/lucene/pull/12824#issuecomment-1817860779 > That's true. However there are some operations like writing to another DataOutput or changing the position is not easily supported by OutputStreamDataOutput. You can do both if y

Re: [PR] Add GrowableByteArrayDataOutput [lucene]

2023-11-19 Thread via GitHub
dungba88 commented on PR #12824: URL: https://github.com/apache/lucene/pull/12824#issuecomment-1817804516 For the record I found out [this commit](https://github.com/apache/lucene/commit/d4e016afdf41baf0104f79e82d953a4650df42aa#diff-f00a2a2a5608b196216542db5756178acb9042ebe5faa2eafa76f6f2c4b

Re: [PR] Add GrowableByteArrayDataOutput [lucene]

2023-11-19 Thread via GitHub
dungba88 commented on PR #12824: URL: https://github.com/apache/lucene/pull/12824#issuecomment-1817799206 > Wouldn't an OutputStreamDataOutput backed by a ByteArrayOutputStream work the same way That's true. However there are some operations like writing to another DataOutput or chan

Re: [PR] Add GrowableByteArrayDataOutput [lucene]

2023-11-19 Thread via GitHub
dweiss commented on PR #12824: URL: https://github.com/apache/lucene/pull/12824#issuecomment-1817796128 I could bet we used to have it somewhere... and then removed it. Wouldn't an OutputStreamDataOutput backed by a ByteArrayOutputStream work the same way (and have similar performance, afte

[PR] Add GrowableByteArrayDataOutput [lucene]

2023-11-18 Thread via GitHub
dungba88 opened a new pull request, #12824: URL: https://github.com/apache/lucene/pull/12824 ### Description Spawn out of #12624 This DataOutput is meant to replace BytesStore. I wasn't sure if it could be useful outside of FST, but as it's only a general purpose DataOutput ba