@Override synchronized public void write(byte b[],int off,int len) throws IOException {
  if (b == null) {
    throw new NullPointerException();
  }
 else   if (off < 0 || len < 0 || len > b.length - off) {
    throw new IndexOutOfBoundsException();
  }
 else   if (len == 0) {
    return;
  }
  c.checkWrite();
  boolean isFirstRecordOfThePayload=true;
  try {
    do {
      boolean holdRecord=false;
      int howmuch;
      if (isFirstRecordOfThePayload && c.needToSplitPayload()) {
        howmuch=Math.min(0x01,r.availableDataBytes());
        if ((len != 1) && (howmuch == 1)) {
          holdRecord=true;
        }
      }
 else {
        howmuch=Math.min(len,r.availableDataBytes());
      }
      if (isFirstRecordOfThePayload && howmuch != 0) {
        isFirstRecordOfThePayload=false;
      }
      if (howmuch > 0) {
        r.write(b,off,howmuch);
        off+=howmuch;
        len-=howmuch;
      }
      c.writeRecord(r,holdRecord);
      c.checkWrite();
    }
 while (len > 0);
  }
 catch (  Exception e) {
    c.handleException(e);
  }
}

@ Override synchronized public void write ( byte b [ ] , int off , int len ) throws IOException { if ( b == null ) { throw new NullPointerException ( ) ; } else if ( off < 0 || len < 0 || len > b . length - off ) { throw new IndexOutOfBoundsException ( ) ; } else if ( len == 0 ) { return ; } c . checkWrite ( ) ; boolean isFirstRecordOfThePayload = true ; try { do { boolean holdRecord = false ; int howmuch ; if ( isFirstRecordOfThePayload && c . needToSplitPayload ( ) ) { howmuch = Math . min ( 0x01 , r . availableDataBytes ( ) ) ; if ( ( len != 1 ) && ( howmuch == 1 ) ) { holdRecord = true ; } } else { howmuch = Math . min ( len , r . availableDataBytes ( ) ) ; } if ( isFirstRecordOfThePayload && howmuch != 0 ) { isFirstRecordOfThePayload = false ; } if ( howmuch > 0 ) { r . write ( b , off , howmuch ) ; off += howmuch ; len -= howmuch ; } c . writeRecord ( r , holdRecord ) ; c . checkWrite ( ) ; } while ( len > 0 ) ; } catch ( Exception e ) { c . handleException ( e ) ; } }
write the data out , now .
