I’m working on a program where I’m compressing a large amount on information and storing it in bytes in a buffer. I can’t use ByteBuffer because I don’t know the finall size.
What would be a better way to implement this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
How about
ByteArrayOutputStream? Granted, it’s not exactly as convenient, but it’ll do what you want. When you’re finished gathering bytes you can just pop out a byte array.