code: @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();
        }
      }
    }
docs: Write data to the stream.