cdm/src/main/java/ucar/ma2/ArrayChar.java
@Override
  public ByteBuffer getDataAsByteBuffer() {
    ByteBuffer bb = ByteBuffer.allocate((int)getSize());
    resetLocalIterator();
    while (hasNext())
      bb.put( nextByte());
    return bb;
  }
@Override
  public ByteBuffer getDataAsByteBuffer() {
    ByteBuffer bb = ByteBuffer.allocate((int)getSize());
    resetLocalIterator();
    while (hasNext())
      bb.put( nextByte());
    return bb;
  }
@ 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.
@return data in a ByteBuffer
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 .