how to use ByteArrayOutputStream and DataOutputStream simultaneously (Java)
- by Manuel
Hi!
I'm having quite a problem here, and I think it is because I don't understand very much how I should use the API provided by Java.
I need to write an int and a byte[] into a byte[]
I thought of using a DataOutputStream to solve the data writing with writeInt(int i) and write(byte[] b), and to be able to put that into a byte array, I should…