You could create a new
ByteArrayOutputStream<http://java.sun.com/javase/6/docs/api/java/io/ByteArrayOutputStream.html>then
call its
toString(charset)<http://java.sun.com/javase/6/docs/api/java/io/ByteArrayOutputStream.html#toString%28java.lang.String%29>method
to convert the result to a string (I'm assuming you're trying to
generate a string when you say js object).

Marcello

On Sat, Jan 2, 2010 at 10:04 PM, bryanwb <[email protected]> wrote:

> I am trying to use Henri Sivonen's excellent htmlparser written in
> java from rhino
>
> I have gotten stuck using the HtmlSerializer constructor which needs
> an Outputstream object.
> nu.validator.htmlparser.sax.HtmlSerializer
>
> HtmlSerializer(OutputStream out)
>
> I am quite ignorant when it comes to java. Can anyone tell me the
> easiest way to create an Outpustream object and convert it to a
> regular js object? I much appreciate the help
>
> Here is a link to the function I am trying to use
>
> http://about.validator.nu/htmlparser/apidocs/nu/validator/htmlparser/sax/HtmlSerializer.html#HtmlSerializer(java.io.OutputStream)<http://about.validator.nu/htmlparser/apidocs/nu/validator/htmlparser/sax/HtmlSerializer.html#HtmlSerializer%28java.io.OutputStream%29>
>
> thanks
>
> _______________________________________________
> dev-tech-js-engine-rhino mailing list
> [email protected]
> https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino
>
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to