Java InputStream Read by Charset tryParseString(InputStream is, String... charsets)

Here you can find the source of tryParseString(InputStream is, String... charsets)

Description

try Parse String

License

Apache License

Declaration

public static String tryParseString(InputStream is, String... charsets)
              throws IOException 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.io.IOException;
import java.io.InputStream;

public class Main {
    public static String tryParseString(InputStream is, String... charsets)
            throws IOException {
        return "";
        // Byte code:
        //   0: aload_0
        //   1: ifnull +12 -> 13
        //   4: aload_1
        //   5: ifnull +8 -> 13
        //   8: aload_1
        //   9: arraylength
        //   10: ifne +13 -> 23
        //   13: new 52   java/lang/IllegalArgumentException
        //   16: dup
        //   17: ldc 53
        //   19: invokespecial 54   java/lang/IllegalArgumentException:<init>   (Ljava/lang/String;)V
        //   22: athrow
        //   23: aconst_null
        //   24: astore_2
        //   25: aconst_null
        //   26: astore_3
        //   27: aconst_null
        //   28: astore 4
        //   30: sipush 128
        //   33: newarray <illegal type>
        //   35: astore 4
        //   37: new 23   java/io/BufferedInputStream
        //   40: dup
        //   41: aload_0
        //   42: invokespecial 26   java/io/BufferedInputStream:<init>   (Ljava/io/InputStream;)V
        //   45: astore_2
        //   46: new 27   java/io/ByteArrayOutputStream
        //   49: dup
        //   50: sipush 128
        //   53: invokespecial 28   java/io/ByteArrayOutputStream:<init>   (I)V
        //   56: astore 5
        //   58: new 5   java/io/BufferedOutputStream
        //   61: dup
        //   62: aload 5
        //   64: invokespecial 8   java/io/BufferedOutputStream:<init>   (Ljava/io/OutputStream;)V
        //   67: astore_3
        //   68: iconst_0
        //   69: istore 6
        //   71: aload_2
        //   72: aload 4
        //   74: invokevirtual 29   java/io/BufferedInputStream:read   ([B)I
        //   77: dup
        //   78: istore 6
        //   80: iconst_m1
        //   81: if_icmpeq +15 -> 96
        //   84: aload_3
        //   85: aload 4
        //   87: iconst_0
        //   88: iload 6
        //   90: invokevirtual 41   java/io/BufferedOutputStream:write   ([BII)V
        //   93: goto -22 -> 71
        //   96: aload_3
        //   97: invokevirtual 56   java/io/BufferedOutputStream:flush   ()V
        //   100: aload 5
        //   102: invokevirtual 31   java/io/ByteArrayOutputStream:toByteArray   ()[B
        //   105: astore 4
        //   107: iconst_2
        //   108: anewarray 42   java/io/Closeable
        //   111: dup
        //   112: iconst_0
        //   113: aload_2
        //   114: aastore
        //   115: dup
        //   116: iconst_1
        //   117: aload_3
        //   118: aastore
        //   119: invokestatic 43   com/taobao/tomcat/util/IOUtils:close   ([Ljava/io/Closeable;)V
        //   122: goto +23 -> 145
        //   125: astore 7
        //   127: iconst_2
        //   128: anewarray 42   java/io/Closeable
        //   131: dup
        //   132: iconst_0
        //   133: aload_2
        //   134: aastore
        //   135: dup
        //   136: iconst_1
        //   137: aload_3
        //   138: aastore
        //   139: invokestatic 43   com/taobao/tomcat/util/IOUtils:close   ([Ljava/io/Closeable;)V
        //   142: aload 7
        //   144: athrow
        //   145: aconst_null
        //   146: astore 5
        //   148: aload_1
        //   149: astore 6
        //   151: aload 6
        //   153: arraylength
        //   154: istore 7
        //   156: iconst_0
        //   157: istore 8
        //   159: iload 8
        //   161: iload 7
        //   163: if_icmpge +46 -> 209
        //   166: aload 6
        //   168: iload 8
        //   170: aaload
        //   171: astore 9
        //   173: aload 9
        //   175: invokestatic 57   java/nio/charset/Charset:forName   (Ljava/lang/String;)Ljava/nio/charset/Charset;
        //   178: invokevirtual 58   java/nio/charset/Charset:newDecoder   ()Ljava/nio/charset/CharsetDecoder;
        //   181: astore 10
        //   183: aload 10
        //   185: aload 4
        //   187: invokestatic 59   java/nio/ByteBuffer:wrap   ([B)Ljava/nio/ByteBuffer;
        //   190: invokevirtual 60   java/nio/charset/CharsetDecoder:decode   (Ljava/nio/ByteBuffer;)Ljava/nio/CharBuffer;
        //   193: invokevirtual 61   java/nio/CharBuffer:toString   ()Ljava/lang/String;
        //   196: areturn
        //   197: astore 10
        //   199: aload 10
        //   201: astore 5
        //   203: iinc 8 1
        //   206: goto -47 -> 159
        //   209: aload 5
        //   211: athrow
        // Line number table:
        //   Java source line #328   -> byte code offset #0
        //   Java source line #329   -> byte code offset #13
        //   Java source line #332   -> byte code offset #23
        //   Java source line #333   -> byte code offset #25
        //   Java source line #334   -> byte code offset #27
        //   Java source line #336   -> byte code offset #30
        //   Java source line #337   -> byte code offset #37
        //   Java source line #338   -> byte code offset #46
        //   Java source line #339   -> byte code offset #58
        //   Java source line #340   -> byte code offset #68
        //   Java source line #341   -> byte code offset #71
        //   Java source line #342   -> byte code offset #84
        //   Java source line #344   -> byte code offset #96
        //   Java source line #346   -> byte code offset #100
        //   Java source line #348   -> byte code offset #107
        //   Java source line #349   -> byte code offset #122
        //   Java source line #348   -> byte code offset #125
        //   Java source line #351   -> byte code offset #145
        //   Java source line #352   -> byte code offset #148
        //   Java source line #355   -> byte code offset #173
        //   Java source line #358   -> byte code offset #183
        //   Java source line #359   -> byte code offset #197
        //   Java source line #360   -> byte code offset #199
        //   Java source line #352   -> byte code offset #203
        //   Java source line #363   -> byte code offset #209
        // Local variable table:
        //   start   length   slot   name   signature
        //   0   212   0   is   InputStream
        //   0   212   1   charsets   String[]
        //   24   110   2   input   BufferedInputStream
        //   26   112   3   output   BufferedOutputStream
        //   28   158   4   buf   byte[]
        //   56   45   5   outBuf   ByteArrayOutputStream
        //   146   64   5   e   IOException
        //   69   20   6   len   int
        //   149   18   6   arr$   String[]
        //   125   18   7   localObject   Object
        //   154   10   7   len$   int
        //   157   47   8   i$   int
        //   171   3   9   charset   String
        //   181   3   10   decoder   java.nio.charset.CharsetDecoder
        //   197   3   10   e1   java.nio.charset.CharacterCodingException
        // Exception table:
        //   from   to   target   type
        //   30   107   125   finally
        //   125   127   125   finally
        //   173   196   197   java/nio/charset/CharacterCodingException
    }//from  ww  w  .  j  av  a 2s  . co m
}

Related

  1. toString(InputStream inputStream, Charset charset)
  2. toString(InputStream is, Charset charset)
  3. toString(InputStream is, String charset)
  4. toString(InputStream source, Charset charset)
  5. toString(InputStream stream, Charset chs)