R
Roedy Green
Lets say I have created a ByteBuffer with CharsetEncoder. encode.
I would like now to see the results.
..array(() is NOT a toArray(). It gives you a backing array with extra
stuff in it.
capacity() is the size the data could grow to without overflowing the
arrray, not the how many bytes are in it right now.
Since there is no length() method or toArray() method, what is the
best way to fake them or get the same net effect?
I will probably answer these question myself, but I thought I should
bring this up because they are obvious puzzles when using this class,
allong the line of how do you get bytes and Strings INTO these things,
with CharSet.wrap and ByteBuffer.wrap most easily.
I would like now to see the results.
..array(() is NOT a toArray(). It gives you a backing array with extra
stuff in it.
capacity() is the size the data could grow to without overflowing the
arrray, not the how many bytes are in it right now.
Since there is no length() method or toArray() method, what is the
best way to fake them or get the same net effect?
I will probably answer these question myself, but I thought I should
bring this up because they are obvious puzzles when using this class,
allong the line of how do you get bytes and Strings INTO these things,
with CharSet.wrap and ByteBuffer.wrap most easily.