buffer - Infinite ByteBuffer in Java -
I am working on a program where I am compressing large amounts of information in the buffer and stored it in bytes I am doing I can not use the ByteBuffer because I do not know the final size. What would be a better way to implement it? How about ByteArrayOutputStream ? It is true that it is not at all convenient, but it will do whatever you want. When you finish collecting bytes, you can only pop the byte array.