putFloat() public method

public putFloat ( float src ) : ByteBuffer
src float
return ByteBuffer
Example #1
0
 public void serialize(ByteBuffer buf)
 {
     buf.putInt(nChans);
     buf.putInt(nSamples);
     buf.putInt(nEvents);
     buf.putFloat(fSample);
     buf.putInt(dataType);
     if (channelNameSize <= nChans) {
         // channel names are all empty or array length does not match
         buf.putInt(0);
     } else {
         buf.putInt(8 + channelNameSize);	// 8 bytes for chunk def
         buf.putInt(CHUNK_CHANNEL_NAMES);
         buf.putInt(channelNameSize);
         for (int i=0;i<nChans;i++) {
             if (labels[i] != null)
                 buf.putString( labels[i]);
             buf.putByte((byte) 0);
         }
     }
 }