@Override public void write(byte[] buf,int offset,int length,boolean isEnd) throws IOException {
  if (_os == null) {
    if (_s == null) {
      return;
    }
    _os=_s.getOutputStream();
  }
  try {
    _needsFlush=true;
    _os.write(buf,offset,length);
    _totalWriteBytes+=length;
  }
 catch (  IOException e) {
    IOException exn=ClientDisconnectException.create(this + ":" + e,e);
    try {
      close();
    }
 catch (    IOException e1) {
    }
    throw exn;
  }
}

@ Override public void write ( byte [ ] buf , int offset , int length , boolean isEnd ) throws IOException { if ( _os == null ) { if ( _s == null ) { return ; } _os = _s . getOutputStream ( ) ; } try { _needsFlush = true ; _os . write ( buf , offset , length ) ; _totalWriteBytes += length ; } catch ( IOException e ) { IOException exn = ClientDisconnectException . create ( this + ":" + e , e ) ; try { close ( ) ; } catch ( IOException e1 ) { } throw exn ; } }
writes bytes to the socket .
