Skip to content
Advertisement

Java mutable byte array data structure

I’m trying to find an easy way to create a mutable byte array that can automatically append any primitive Java data type. I’ve been searching but could not find anything useful.

I’m looking for something like this

JavaScript

There is ByteByffer which is great, but you have to know the size of the buffer before you start, which won’t work in my case. There is a similar thing (StringBuilder) for creating Strings, but I cannot find one for Bytes.

I thought this would be obvious in Java.

Advertisement

Answer

I guess you are looking for java.io.DataOutputStream

JavaScript

How to use storingData?

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement