Byte array of unknown length in java
|March 19, 2009||Posted by forumadmin under TechQns||
I am constructing an array of bytes in java and I don’t know how long the array will be.
I want some tool like Java’s StringBuffer that you can just call .append(byte b) or .append(byte buf) and have it buffer all my bytes and return to me a byte array when I’m done. Is there a class that does for bytes what StringBuffer does for Strings? It does not look like the ByteBuffer class is what I’m looking for.
Anyone have a good solution?
|Asked By – jbu||Read Answers|