public class org.glassfish.grizzly.websockets.Utf8Utils
minor version: 0
major version: 59
flags: flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: org.glassfish.grizzly.websockets.Utf8Utils
super_class: java.lang.Object
{
private static final byte[] EMPTY_ARRAY;
descriptor: [B
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
static void <clinit>();
descriptor: ()V
flags: (0x0008) ACC_STATIC
Code:
stack=1, locals=0, args_size=0
0: iconst_0
newarray 8
putstatic org.glassfish.grizzly.websockets.Utf8Utils.EMPTY_ARRAY:[B
return
LocalVariableTable:
Start End Slot Name Signature
public void <init>();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
invokespecial java.lang.Object.<init>:()V
return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lorg/glassfish/grizzly/websockets/Utf8Utils;
public static byte[] encode(java.nio.charset.Charset, java.lang.String);
descriptor: (Ljava/nio/charset/Charset;Ljava/lang/String;)[B
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=4, locals=8, args_size=2
start local 0 start local 1 0: aload 1
invokevirtual java.lang.String.length:()I
ifne 2
1: getstatic org.glassfish.grizzly.websockets.Utf8Utils.EMPTY_ARRAY:[B
areturn
2: StackMap locals:
StackMap stack:
aload 0
invokestatic org.glassfish.grizzly.utils.Charsets.getCharsetEncoder:(Ljava/nio/charset/Charset;)Ljava/nio/charset/CharsetEncoder;
astore 2
start local 2 3: aload 1
invokevirtual java.lang.String.length:()I
aload 2
invokevirtual java.nio.charset.CharsetEncoder.maxBytesPerChar:()F
invokestatic org.glassfish.grizzly.websockets.Utf8Utils.scale:(IF)I
istore 3
start local 3 4: iload 3
newarray 8
astore 4
start local 4 5: aload 2
invokevirtual java.nio.charset.CharsetEncoder.reset:()Ljava/nio/charset/CharsetEncoder;
pop
6: aload 4
invokestatic java.nio.ByteBuffer.wrap:([B)Ljava/nio/ByteBuffer;
astore 5
start local 5 7: aload 1
invokestatic java.nio.CharBuffer.wrap:(Ljava/lang/CharSequence;)Ljava/nio/CharBuffer;
astore 6
start local 6 8: aload 2
aload 6
aload 5
iconst_1
invokevirtual java.nio.charset.CharsetEncoder.encode:(Ljava/nio/CharBuffer;Ljava/nio/ByteBuffer;Z)Ljava/nio/charset/CoderResult;
astore 7
start local 7 9: aload 7
invokevirtual java.nio.charset.CoderResult.isUnderflow:()Z
ifne 11
10: aload 7
invokevirtual java.nio.charset.CoderResult.throwException:()V
11: StackMap locals: java.nio.charset.Charset java.lang.String java.nio.charset.CharsetEncoder int byte[] java.nio.ByteBuffer java.nio.CharBuffer java.nio.charset.CoderResult
StackMap stack:
aload 2
aload 5
invokevirtual java.nio.charset.CharsetEncoder.flush:(Ljava/nio/ByteBuffer;)Ljava/nio/charset/CoderResult;
astore 7
12: aload 7
invokevirtual java.nio.charset.CoderResult.isUnderflow:()Z
ifne 17
13: aload 7
invokevirtual java.nio.charset.CoderResult.throwException:()V
end local 7 14: goto 17
StackMap locals: java.nio.charset.Charset java.lang.String java.nio.charset.CharsetEncoder int byte[] java.nio.ByteBuffer java.nio.CharBuffer
StackMap stack: java.nio.charset.CharacterCodingException
15: astore 7
start local 7 16: new java.lang.Error
dup
aload 7
invokespecial java.lang.Error.<init>:(Ljava/lang/Throwable;)V
athrow
end local 7 17: StackMap locals:
StackMap stack:
aload 4
aload 5
invokevirtual java.nio.ByteBuffer.position:()I
invokestatic org.glassfish.grizzly.websockets.Utf8Utils.safeTrim:([BI)[B
areturn
end local 6 end local 5 end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 18 0 charset Ljava/nio/charset/Charset;
0 18 1 string Ljava/lang/String;
3 18 2 ce Ljava/nio/charset/CharsetEncoder;
4 18 3 en I
5 18 4 ba [B
7 18 5 bb Ljava/nio/ByteBuffer;
8 18 6 cb Ljava/nio/CharBuffer;
9 14 7 cr Ljava/nio/charset/CoderResult;
16 17 7 x Ljava/nio/charset/CharacterCodingException;
Exception table:
from to target type
8 14 15 Class java.nio.charset.CharacterCodingException
MethodParameters:
Name Flags
charset
string
public static void encode(java.nio.charset.Charset, java.lang.String, java.io.OutputStream);
descriptor: (Ljava/nio/charset/Charset;Ljava/lang/String;Ljava/io/OutputStream;)V
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=4, locals=9, args_size=3
start local 0 start local 1 start local 2 0: aload 1
invokevirtual java.lang.String.length:()I
ifne 2
1: return
2: StackMap locals:
StackMap stack:
aload 0
invokestatic org.glassfish.grizzly.utils.Charsets.getCharsetEncoder:(Ljava/nio/charset/Charset;)Ljava/nio/charset/CharsetEncoder;
astore 3
start local 3 3: aload 1
invokevirtual java.lang.String.length:()I
aload 3
invokevirtual java.nio.charset.CharsetEncoder.maxBytesPerChar:()F
invokestatic org.glassfish.grizzly.websockets.Utf8Utils.scale:(IF)I
istore 4
start local 4 4: iload 4
newarray 8
astore 5
start local 5 5: aload 3
invokevirtual java.nio.charset.CharsetEncoder.reset:()Ljava/nio/charset/CharsetEncoder;
pop
6: aload 5
invokestatic java.nio.ByteBuffer.wrap:([B)Ljava/nio/ByteBuffer;
astore 6
start local 6 7: aload 1
invokestatic java.nio.CharBuffer.wrap:(Ljava/lang/CharSequence;)Ljava/nio/CharBuffer;
astore 7
start local 7 8: aload 3
aload 7
aload 6
iconst_1
invokevirtual java.nio.charset.CharsetEncoder.encode:(Ljava/nio/CharBuffer;Ljava/nio/ByteBuffer;Z)Ljava/nio/charset/CoderResult;
astore 8
start local 8 9: aload 8
invokevirtual java.nio.charset.CoderResult.isUnderflow:()Z
ifne 11
10: aload 8
invokevirtual java.nio.charset.CoderResult.throwException:()V
11: StackMap locals: java.nio.charset.Charset java.lang.String java.io.OutputStream java.nio.charset.CharsetEncoder int byte[] java.nio.ByteBuffer java.nio.CharBuffer java.nio.charset.CoderResult
StackMap stack:
aload 3
aload 6
invokevirtual java.nio.charset.CharsetEncoder.flush:(Ljava/nio/ByteBuffer;)Ljava/nio/charset/CoderResult;
astore 8
12: aload 8
invokevirtual java.nio.charset.CoderResult.isUnderflow:()Z
ifne 17
13: aload 8
invokevirtual java.nio.charset.CoderResult.throwException:()V
end local 8 14: goto 17
StackMap locals: java.nio.charset.Charset java.lang.String java.io.OutputStream java.nio.charset.CharsetEncoder int byte[] java.nio.ByteBuffer java.nio.CharBuffer
StackMap stack: java.nio.charset.CharacterCodingException
15: astore 8
start local 8 16: new java.lang.Error
dup
aload 8
invokespecial java.lang.Error.<init>:(Ljava/lang/Throwable;)V
athrow
end local 8 17: StackMap locals:
StackMap stack:
aload 2
aload 5
iconst_0
aload 6
invokevirtual java.nio.ByteBuffer.position:()I
invokevirtual java.io.OutputStream.write:([BII)V
18: return
end local 7 end local 6 end local 5 end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 19 0 charset Ljava/nio/charset/Charset;
0 19 1 string Ljava/lang/String;
0 19 2 os Ljava/io/OutputStream;
3 19 3 ce Ljava/nio/charset/CharsetEncoder;
4 19 4 en I
5 19 5 ba [B
7 19 6 bb Ljava/nio/ByteBuffer;
8 19 7 cb Ljava/nio/CharBuffer;
9 14 8 cr Ljava/nio/charset/CoderResult;
16 17 8 x Ljava/nio/charset/CharacterCodingException;
Exception table:
from to target type
8 14 15 Class java.nio.charset.CharacterCodingException
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
charset
string
os
private static int scale(int, float);
descriptor: (IF)I
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=4, locals=2, args_size=2
start local 0 start local 1 0: iload 0
i2d
fload 1
f2d
dmul
d2i
ireturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 len I
0 1 1 expansionFactor F
MethodParameters:
Name Flags
len
expansionFactor
private static byte[] safeTrim(byte[], int);
descriptor: ([BI)[B
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=2, locals=2, args_size=2
start local 0 start local 1 0: iload 1
aload 0
arraylength
if_icmpne 2
invokestatic java.lang.System.getSecurityManager:()Ljava/lang/SecurityManager;
ifnonnull 2
1: aload 0
areturn
2: StackMap locals:
StackMap stack:
aload 0
iload 1
invokestatic org.glassfish.grizzly.websockets.Utf8Utils.copyOf:([BI)[B
areturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 ba [B
0 3 1 len I
MethodParameters:
Name Flags
ba
len
private static byte[] copyOf(byte[], int);
descriptor: ([BI)[B
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=6, locals=3, args_size=2
start local 0 start local 1 0: iload 1
newarray 8
astore 2
start local 2 1: aload 0
iconst_0
aload 2
iconst_0
aload 0
arraylength
iload 1
invokestatic java.lang.Math.min:(II)I
invokestatic java.lang.System.arraycopy:(Ljava/lang/Object;ILjava/lang/Object;II)V
2: aload 2
areturn
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 original [B
0 3 1 newLength I
1 3 2 copy [B
MethodParameters:
Name Flags
original
newLength
}
SourceFile: "Utf8Utils.java"