org.eclipse.jetty.util.IO.toString()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(166)

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

IO.toString介绍

[英]Read input stream to string.
[中]

代码示例

代码示例来源:origin: org.eclipse.jetty/jetty-util

  1. /** Read input stream to string.
  2. * @param in the stream to read from (until EOF)
  3. * @return the String parsed from stream (default Charset)
  4. * @throws IOException if unable to read the stream (or handle the charset)
  5. */
  6. public static String toString(InputStream in)
  7. throws IOException
  8. {
  9. return toString(in,(Charset)null);
  10. }

代码示例来源:origin: org.eclipse.jetty/jetty-util

  1. /** Read input stream to string.
  2. * @param in the stream to read from (until EOF)
  3. * @param encoding the encoding to use (can be null to use default Charset)
  4. * @return the String parsed from the stream
  5. * @throws IOException if unable to read the stream (or handle the charset)
  6. */
  7. public static String toString(InputStream in,String encoding)
  8. throws IOException
  9. {
  10. return toString(in, encoding==null?null:Charset.forName(encoding));
  11. }

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

  1. /** Read input stream to string.
  2. */
  3. public static String toString(InputStream in)
  4. throws IOException
  5. {
  6. return toString(in,null);
  7. }

代码示例来源:origin: Nextdoor/bender

  1. /** Read input stream to string.
  2. */
  3. public static String toString(InputStream in)
  4. throws IOException
  5. {
  6. return toString(in,(Charset)null);
  7. }

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

  1. /** Read input stream to string.
  2. */
  3. public static String toString(InputStream in)
  4. throws IOException
  5. {
  6. return toString(in,null);
  7. }

代码示例来源:origin: jenkinsci/winstone

  1. /** Read input stream to string.
  2. * @param in the stream to read from (until EOF)
  3. * @return the String parsed from stream (default Charset)
  4. * @throws IOException if unable to read the stream (or handle the charset)
  5. */
  6. public static String toString(InputStream in)
  7. throws IOException
  8. {
  9. return toString(in,(Charset)null);
  10. }

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server

  1. /** Read input stream to string.
  2. */
  3. public static String toString(InputStream in)
  4. throws IOException
  5. {
  6. return toString(in,null);
  7. }

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp

  1. /** Read input stream to string.
  2. */
  3. public static String toString(InputStream in)
  4. throws IOException
  5. {
  6. return toString(in,null);
  7. }

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-plus

  1. /** Read input stream to string.
  2. */
  3. public static String toString(InputStream in)
  4. throws IOException
  5. {
  6. return toString(in,null);
  7. }

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

  1. /** Read input stream to string.
  2. */
  3. public static String toString(InputStream in)
  4. throws IOException
  5. {
  6. return toString(in,null);
  7. }

代码示例来源:origin: Nextdoor/bender

  1. /** Read input stream to string.
  2. */
  3. public static String toString(InputStream in,String encoding)
  4. throws IOException
  5. {
  6. return toString(in, encoding==null?null:Charset.forName(encoding));
  7. }

代码示例来源:origin: jenkinsci/winstone

  1. /** Read input stream to string.
  2. * @param in the stream to read from (until EOF)
  3. * @param encoding the encoding to use (can be null to use default Charset)
  4. * @return the String parsed from the stream
  5. * @throws IOException if unable to read the stream (or handle the charset)
  6. */
  7. public static String toString(InputStream in,String encoding)
  8. throws IOException
  9. {
  10. return toString(in, encoding==null?null:Charset.forName(encoding));
  11. }

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp

  1. /**
  2. * @deprecated use {@link #parse(Reader)}
  3. * @param in
  4. * Reader containing JSON object or array.
  5. * @return A Map, Object array or primitive array parsed from the JSON.
  6. */
  7. @Deprecated
  8. public static Object parse(InputStream in) throws IOException
  9. {
  10. return DEFAULT.parse(new StringSource(IO.toString(in)),false);
  11. }

代码示例来源:origin: org.eclipse.jetty/jetty-util-ajax

  1. /**
  2. * @param in
  3. * Reader containing JSON object or array.
  4. * @return A Map, Object array or primitive array parsed from the JSON.
  5. * @throws IOException if unable to parse
  6. * @deprecated use {@link #parse(Reader)}
  7. */
  8. @Deprecated
  9. public static Object parse(InputStream in) throws IOException
  10. {
  11. return DEFAULT.parse(new StringSource(IO.toString(in)),false);
  12. }

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server

  1. /**
  2. * @deprecated use {@link #parse(Reader)}
  3. * @param in
  4. * Reader containing JSON object or array.
  5. * @return A Map, Object array or primitive array parsed from the JSON.
  6. */
  7. @Deprecated
  8. public static Object parse(InputStream in) throws IOException
  9. {
  10. return DEFAULT.parse(new StringSource(IO.toString(in)),false);
  11. }

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server

  1. /**
  2. * @deprecated use {@link #parse(Reader, boolean)}
  3. * @param in
  4. * Stream containing JSON object or array.
  5. * @param stripOuterComment
  6. * If true, an outer comment around the JSON is ignored.
  7. * @return A Map, Object array or primitive array parsed from the JSON.
  8. */
  9. @Deprecated
  10. public static Object parse(InputStream in, boolean stripOuterComment) throws IOException
  11. {
  12. return DEFAULT.parse(new StringSource(IO.toString(in)),stripOuterComment);
  13. }

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

  1. /**
  2. * @deprecated use {@link #parse(Reader, boolean)}
  3. * @param in
  4. * Stream containing JSON object or array.
  5. * @param stripOuterComment
  6. * If true, an outer comment around the JSON is ignored.
  7. * @return A Map, Object array or primitive array parsed from the JSON.
  8. */
  9. @Deprecated
  10. public static Object parse(InputStream in, boolean stripOuterComment) throws IOException
  11. {
  12. return DEFAULT.parse(new StringSource(IO.toString(in)),stripOuterComment);
  13. }

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

  1. /**
  2. * @deprecated use {@link #parse(Reader)}
  3. * @param in
  4. * Reader containing JSON object or array.
  5. * @return A Map, Object array or primitive array parsed from the JSON.
  6. */
  7. @Deprecated
  8. public static Object parse(InputStream in) throws IOException
  9. {
  10. return DEFAULT.parse(new StringSource(IO.toString(in)),false);
  11. }

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-plus

  1. /**
  2. * @deprecated use {@link #parse(Reader)}
  3. * @param in
  4. * Reader containing JSON object or array.
  5. * @return A Map, Object array or primitive array parsed from the JSON.
  6. */
  7. @Deprecated
  8. public static Object parse(InputStream in) throws IOException
  9. {
  10. return DEFAULT.parse(new StringSource(IO.toString(in)),false);
  11. }

代码示例来源:origin: org.jbpm.contrib/repository

  1. private String getResponse(URI uri) throws IOException {
  2. HttpURLConnection http = (HttpURLConnection) uri.toURL().openConnection();
  3. assertThat("Valid Response Code",
  4. http.getResponseCode(),
  5. anyOf(is(200),
  6. is(404)));
  7. try (InputStream in = http.getInputStream()) {
  8. return IO.toString(in,
  9. StandardCharsets.UTF_8);
  10. }
  11. }

相关文章