org.mozilla.javascript.tools.shell.Global.readReader()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 JavaScript  
字(2.8k)|赞(0)|评价(0)|浏览(209)

本文整理了Java中org.mozilla.javascript.tools.shell.Global.readReader()方法的一些代码示例,展示了Global.readReader()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Global.readReader()方法的具体详情如下:
包路径:org.mozilla.javascript.tools.shell.Global
类名称:Global
方法名:readReader

Global.readReader介绍

暂无

代码示例

代码示例来源:origin: com.github.tntim96/rhino

private static String readReader(Reader reader)
  throws IOException
{
  return readReader(reader, 4096);
}

代码示例来源:origin: ro.isdc.wro4j/rhino

private static String readReader(Reader reader)
  throws IOException
{
  return readReader(reader, 4096);
}

代码示例来源:origin: org.jvnet.hudson/embedded-rhino-debugger

private static String readReader(Reader reader)
  throws IOException
{
  return readReader(reader, 4096);
}

代码示例来源:origin: com.github.tntim96/rhino

private static InputStream toInputStream(Object value)
  throws IOException
{
  InputStream is = null;
  String s = null;
  if (value instanceof Wrapper) {
    Object unwrapped = ((Wrapper)value).unwrap();
    if (unwrapped instanceof InputStream) {
      is = (InputStream)unwrapped;
    } else if (unwrapped instanceof byte[]) {
      is = new ByteArrayInputStream((byte[])unwrapped);
    } else if (unwrapped instanceof Reader) {
      s = readReader((Reader)unwrapped);
    } else if (unwrapped instanceof char[]) {
      s = new String((char[])unwrapped);
    }
  }
  if (is == null) {
    if (s == null) { s = ScriptRuntime.toString(value); }
    is = new ByteArrayInputStream(s.getBytes());
  }
  return is;
}

代码示例来源:origin: org.jvnet.hudson/embedded-rhino-debugger

private static InputStream toInputStream(Object value)
  throws IOException
{
  InputStream is = null;
  String s = null;
  if (value instanceof Wrapper) {
    Object unwrapped = ((Wrapper)value).unwrap();
    if (unwrapped instanceof InputStream) {
      is = (InputStream)unwrapped;
    } else if (unwrapped instanceof byte[]) {
      is = new ByteArrayInputStream((byte[])unwrapped);
    } else if (unwrapped instanceof Reader) {
      s = readReader((Reader)unwrapped);
    } else if (unwrapped instanceof char[]) {
      s = new String((char[])unwrapped);
    }
  }
  if (is == null) {
    if (s == null) { s = ScriptRuntime.toString(value); }
    is = new ByteArrayInputStream(s.getBytes());
  }
  return is;
}

代码示例来源:origin: ro.isdc.wro4j/rhino

private static InputStream toInputStream(Object value)
  throws IOException
{
  InputStream is = null;
  String s = null;
  if (value instanceof Wrapper) {
    Object unwrapped = ((Wrapper)value).unwrap();
    if (unwrapped instanceof InputStream) {
      is = (InputStream)unwrapped;
    } else if (unwrapped instanceof byte[]) {
      is = new ByteArrayInputStream((byte[])unwrapped);
    } else if (unwrapped instanceof Reader) {
      s = readReader((Reader)unwrapped);
    } else if (unwrapped instanceof char[]) {
      s = new String((char[])unwrapped);
    }
  }
  if (is == null) {
    if (s == null) { s = ScriptRuntime.toString(value); }
    is = new ByteArrayInputStream(s.getBytes());
  }
  return is;
}

代码示例来源:origin: ro.isdc.wro4j/rhino

r = new InputStreamReader(is, charCoding);
return readReader(r, chunkLength);

代码示例来源:origin: org.jvnet.hudson/embedded-rhino-debugger

r = new InputStreamReader(is, charCoding);
return readReader(r, chunkLength);

代码示例来源:origin: com.github.tntim96/rhino

r = new InputStreamReader(is, charCoding);
return readReader(r, chunkLength);

相关文章