code: public static void write( Document bson,
                                OutputStream stream ) throws IOException {
          getCompactJsonWriter().write(bson, stream);
      }
docs: Write to the supplied writer the modified JSON representation of the supplied in-memory {@link Document}. The resulting
  JSON will have no embedded line feeds or extra spaces.
  <p>
  This format is compact and easy for software to read, but usually very difficult for people to read anything but very small
  documents.
  </p>
  
  @param bson the BSON object or BSON value; may not be null
  @param stream the output stream; may not be null
  @throws IOException if there was a problem reading from the stream