core/src/main/java/org/owasp/encoder/Encode.java
public static void forJavaScriptSource(Writer out, String input)
        throws IOException
    {
        encode(Encoders.JAVASCRIPT_SOURCE_ENCODER, out, input);
    }
public static void forJavaScriptSource(Writer out, String input)
        throws IOException
    {
        encode(Encoders.JAVASCRIPT_SOURCE_ENCODER, out, input);
    }
See {@link #forJavaScriptSource(String)} for description of encoding.  This
version writes directly to a Writer without an intervening string.

@param out where to write encoded output
@param input the input string to encode
@throws IOException if thrown by writer