static void writeReqFrame(ByteBuffer bb,int methodId,long seq,int length) throws IOException {
  int oldPos=bb.position();
  boolean success=false;
  try {
    bb.order(ByteOrder.LITTLE_ENDIAN);
    bb.putInt(HRPC_MAGIC);
    bb.putInt(methodId);
    bb.putLong(seq);
    bb.putInt(length);
    success=true;
  }
  finally {
    if (!success) {
      bb.position(oldPos);
    }
  }
}

static void writeReqFrame ( ByteBuffer bb , int methodId , long seq , int length ) throws IOException { int oldPos = bb . position ( ) ; boolean success = false ; try { bb . order ( ByteOrder . LITTLE_ENDIAN ) ; bb . putInt ( HRPC_MAGIC ) ; bb . putInt ( methodId ) ; bb . putLong ( seq ) ; bb . putInt ( length ) ; success = true ; } finally { if ( ! success ) { bb . position ( oldPos ) ; } } }
write the fixed - length request frame which starts packed rpc messages .
