Re: RFR: 8308753: Class-File API transition to Preview [v24]

2023-11-08 Thread Chen Liang
On Wed, 8 Nov 2023 15:45:56 GMT, Konrad Windszus wrote: > I know, but for memory consumption reasons everyone should prefer just > passing an InputStream. Is the memory consumption with > `ClassFile.of().parse(Path)` any better (i.e. are you using a > `java.io.RandomAccessFile` or `java.nio.ch

Re: RFR: 8308753: Class-File API transition to Preview [v24]

2023-11-08 Thread Konrad Windszus
On Wed, 8 Nov 2023 14:07:04 GMT, Chen Liang wrote: > You can simply call `ClassFile.of().parse(inputStream.readAllBytes())` > instead. I know, but for memory consumption reasons everyone should prefer just passing an InputStream. Is the memory consumption with `ClassFile.of().parse(Path)` any

Re: RFR: 8308753: Class-File API transition to Preview [v24]

2023-11-08 Thread Chen Liang
On Wed, 8 Nov 2023 13:31:32 GMT, Konrad Windszus wrote: > I would appreciate a hint in the javadocs why `Classfile.of` requires a byte > array and cannot deal with inputstreams (iiuc this is due to the lazy reading > which requires adjusting the offset back and forth potentially) You can simpl

Re: RFR: 8308753: Class-File API transition to Preview [v24]

2023-11-08 Thread Konrad Windszus
On Fri, 3 Nov 2023 08:39:37 GMT, Adam Sotona wrote: >> Classfile API is an internal library under package `jdk.internal.classfile`  >> in JDK 21. >> This pull request turns the Classfile API into a preview feature and moves >> it into `java.lang.classfile`. >> It repackages all uses across JDK a

Re: RFR: 8308753: Class-File API transition to Preview [v24]

2023-11-03 Thread Adam Sotona
> Classfile API is an internal library under package `jdk.internal.classfile`  > in JDK 21. > This pull request turns the Classfile API into a preview feature and moves it > into `java.lang.classfile`. > It repackages all uses across JDK and tests and adds lots of missing Javadoc. > > This PR goe