@ Override public ByteBuffer getDataAsByteBuffer ( ) { ByteBuffer bb = ByteBuffer . allocate ( ( int ) getSize ( ) ) ; resetLocalIterator ( ) ; while ( hasNext ( ) ) bb . put ( nextByte ( ) ) ; return bb ; }
Trasfer data to a ByteBuffer . Note we cast char to byte discarding top byte if any . This is because CDM char is really a byte not a java char .