@Override public void write(byte[] buf,int offset,int length,boolean isEnd) throws IOException {
  OutputStream stream=getStream();
  if (stream == null) {
    return;
  }
synchronized (stream) {
    stream.write(buf,offset,length);
    if (isEnd) {
      stream.flush();
    }
  }
}

@ Override public void write ( byte [ ] buf , int offset , int length , boolean isEnd ) throws IOException { OutputStream stream = getStream ( ) ; if ( stream == null ) { return ; } synchronized ( stream ) { stream . write ( buf , offset , length ) ; if ( isEnd ) { stream . flush ( ) ; } } }
write data to the stream .
