/**
   * Encode the value and write to the buffer
   *
   * @param val Value to encode
   * @param buf Buffer to write encoded value
   * @return Number of bytes encoded
   */
  public int write_sdnv(long val, IByteBuffer buf) {

    int sdnv_len = SDNV.encode(val, buf);
    assert (sdnv_len > 0) : TAG + "write sdnv: incorrect length";
    ;
    return sdnv_len;
  }
Beispiel #2
0
 /**
  * Encode this into SDNV and move the buffer position
  *
  * @param dt DTNTime to encode
  * @param buf Serializable Buffer to store SDNV of DTNTime
  */
 public static void encodeSDNV(DTNTime dt, IByteBuffer buf) {
   SDNV.encode(dt.seconds_, buf);
   SDNV.encode(dt.nanoseconds_, buf);
 }