237238239240241242243244245246247
public byte toByteArray()[] { if (buffer == null) { return new byte[0]; } final DynamicByteBuffer duplicate = buffer.duplicate(); duplicate.flip(); final byte newBuffer[] = new byte[duplicate.limit()]; duplicate.get(newBuffer); return newBuffer; }
239240241242243244245246247248249
public byte toByteArray()[] { if (buffer == null) { return new byte[0]; } final DynamicByteBuffer duplicate = buffer.duplicate(); duplicate.flip(); final byte[] newBuffer = new byte[duplicate.limit()]; duplicate.get(newBuffer); return newBuffer; }