final class org.jruby.util.io.SeekableByteChannelImpl extends java.nio.channels.spi.AbstractInterruptibleChannel implements java.nio.channels.ReadableByteChannel, java.nio.channels.SeekableByteChannel
minor version: 0
major version: 59
flags: flags: (0x0030) ACC_FINAL, ACC_SUPER
this_class: org.jruby.util.io.SeekableByteChannelImpl
super_class: java.nio.channels.spi.AbstractInterruptibleChannel
{
private final java.io.ByteArrayInputStream in;
descriptor: Ljava/io/ByteArrayInputStream;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
private final int mark;
descriptor: I
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
private final int count;
descriptor: I
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
private int truncatedBy;
descriptor: I
flags: (0x0002) ACC_PRIVATE
static final boolean USABLE;
descriptor: Z
flags: (0x0018) ACC_STATIC, ACC_FINAL
private static final java.lang.reflect.Field posField;
descriptor: Ljava/lang/reflect/Field;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
private static final java.lang.reflect.Field countField;
descriptor: Ljava/lang/reflect/Field;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
private static final java.lang.reflect.Field markField;
descriptor: Ljava/lang/reflect/Field;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
static void <clinit>();
descriptor: ()V
flags: (0x0008) ACC_STATIC
Code:
stack=2, locals=0, args_size=0
0: ldc "pos"
invokestatic org.jruby.util.io.SeekableByteChannelImpl.accessibleField:(Ljava/lang/String;)Ljava/lang/reflect/Field;
putstatic org.jruby.util.io.SeekableByteChannelImpl.posField:Ljava/lang/reflect/Field;
1: getstatic org.jruby.util.io.SeekableByteChannelImpl.posField:Ljava/lang/reflect/Field;
ifnull 6
2: ldc "count"
invokestatic org.jruby.util.io.SeekableByteChannelImpl.accessibleField:(Ljava/lang/String;)Ljava/lang/reflect/Field;
putstatic org.jruby.util.io.SeekableByteChannelImpl.countField:Ljava/lang/reflect/Field;
3: ldc "mark"
invokestatic org.jruby.util.io.SeekableByteChannelImpl.accessibleField:(Ljava/lang/String;)Ljava/lang/reflect/Field;
putstatic org.jruby.util.io.SeekableByteChannelImpl.markField:Ljava/lang/reflect/Field;
4: iconst_1
putstatic org.jruby.util.io.SeekableByteChannelImpl.USABLE:Z
5: goto 8
6: StackMap locals:
StackMap stack:
aconst_null
dup
putstatic org.jruby.util.io.SeekableByteChannelImpl.markField:Ljava/lang/reflect/Field;
putstatic org.jruby.util.io.SeekableByteChannelImpl.countField:Ljava/lang/reflect/Field;
7: iconst_0
putstatic org.jruby.util.io.SeekableByteChannelImpl.USABLE:Z
8: StackMap locals:
StackMap stack:
return
LocalVariableTable:
Start End Slot Name Signature
void <init>(java.io.ByteArrayInputStream);
descriptor: (Ljava/io/ByteArrayInputStream;)V
flags: (0x0000)
Code:
stack=2, locals=2, args_size=2
start local 0 start local 1 0: aload 0
invokespecial java.nio.channels.spi.AbstractInterruptibleChannel.<init>:()V
1: aload 0
iconst_0
putfield org.jruby.util.io.SeekableByteChannelImpl.truncatedBy:I
2: aload 0
aload 1
putfield org.jruby.util.io.SeekableByteChannelImpl.in:Ljava/io/ByteArrayInputStream;
3: aload 0
aload 1
invokestatic org.jruby.util.io.SeekableByteChannelImpl.mark:(Ljava/io/ByteArrayInputStream;)I
putfield org.jruby.util.io.SeekableByteChannelImpl.mark:I
4: aload 0
aload 1
invokestatic org.jruby.util.io.SeekableByteChannelImpl.count:(Ljava/io/ByteArrayInputStream;)I
putfield org.jruby.util.io.SeekableByteChannelImpl.count:I
5: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 6 0 this Lorg/jruby/util/io/SeekableByteChannelImpl;
0 6 1 in Ljava/io/ByteArrayInputStream;
MethodParameters:
Name Flags
in
public synchronized int read(java.nio.ByteBuffer);
descriptor: (Ljava/nio/ByteBuffer;)I
flags: (0x0021) ACC_PUBLIC, ACC_SYNCHRONIZED
Code:
stack=4, locals=7, args_size=2
start local 0 start local 1 0: aload 0
getfield org.jruby.util.io.SeekableByteChannelImpl.in:Ljava/io/ByteArrayInputStream;
invokevirtual java.io.ByteArrayInputStream.available:()I
aload 0
getfield org.jruby.util.io.SeekableByteChannelImpl.truncatedBy:I
isub
istore 2
start local 2 1: iload 2
ifgt 2
iconst_0
ireturn
2: StackMap locals: int
StackMap stack:
aload 1
invokevirtual java.nio.ByteBuffer.remaining:()I
istore 3
start local 3 3: iconst_0
istore 4
start local 4 4: iload 3
iload 2
if_icmple 5
iload 2
istore 3
5: StackMap locals: int int
StackMap stack:
iload 3
newarray 8
astore 5
start local 5 6: aload 0
invokevirtual org.jruby.util.io.SeekableByteChannelImpl.begin:()V
7: aload 0
getfield org.jruby.util.io.SeekableByteChannelImpl.in:Ljava/io/ByteArrayInputStream;
aload 5
invokevirtual java.io.ByteArrayInputStream.read:([B)I
istore 4
8: goto 14
9: StackMap locals: org.jruby.util.io.SeekableByteChannelImpl java.nio.ByteBuffer int int int byte[]
StackMap stack: java.lang.Throwable
astore 6
10: aload 0
iload 4
iflt 11
iconst_1
goto 12
StackMap locals: org.jruby.util.io.SeekableByteChannelImpl java.nio.ByteBuffer int int int byte[] java.lang.Throwable
StackMap stack: org.jruby.util.io.SeekableByteChannelImpl
11: iconst_0
StackMap locals: org.jruby.util.io.SeekableByteChannelImpl java.nio.ByteBuffer int int int byte[] java.lang.Throwable
StackMap stack: org.jruby.util.io.SeekableByteChannelImpl int
12: invokevirtual org.jruby.util.io.SeekableByteChannelImpl.end:(Z)V
13: aload 6
athrow
14: StackMap locals:
StackMap stack:
aload 0
iload 4
iflt 15
iconst_1
goto 16
StackMap locals:
StackMap stack: org.jruby.util.io.SeekableByteChannelImpl
15: iconst_0
StackMap locals: org.jruby.util.io.SeekableByteChannelImpl java.nio.ByteBuffer int int int byte[]
StackMap stack: org.jruby.util.io.SeekableByteChannelImpl int
16: invokevirtual org.jruby.util.io.SeekableByteChannelImpl.end:(Z)V
17: iload 4
ifle 19
18: aload 1
aload 5
iconst_0
iload 4
invokevirtual java.nio.ByteBuffer.put:([BII)Ljava/nio/ByteBuffer;
pop
19: StackMap locals:
StackMap stack:
iload 4
ireturn
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 20 0 this Lorg/jruby/util/io/SeekableByteChannelImpl;
0 20 1 target Ljava/nio/ByteBuffer;
1 20 2 available I
3 20 3 maxToRead I
4 20 4 readCount I
6 20 5 readBytes [B
Exception table:
from to target type
6 9 9 any
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
target
protected void implCloseChannel();
descriptor: ()V
flags: (0x0004) ACC_PROTECTED
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
getfield org.jruby.util.io.SeekableByteChannelImpl.in:Ljava/io/ByteArrayInputStream;
invokevirtual java.io.ByteArrayInputStream.close:()V
return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lorg/jruby/util/io/SeekableByteChannelImpl;
Exceptions:
throws java.io.IOException
public long position();
descriptor: ()J
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=1, args_size=1
start local 0 0: aload 0
getfield org.jruby.util.io.SeekableByteChannelImpl.in:Ljava/io/ByteArrayInputStream;
invokestatic org.jruby.util.io.SeekableByteChannelImpl.pos:(Ljava/io/ByteArrayInputStream;)I
aload 0
getfield org.jruby.util.io.SeekableByteChannelImpl.mark:I
isub
i2l
lreturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lorg/jruby/util/io/SeekableByteChannelImpl;
public synchronized java.nio.channels.SeekableByteChannel position(long);
descriptor: (J)Ljava/nio/channels/SeekableByteChannel;
flags: (0x0021) ACC_PUBLIC, ACC_SYNCHRONIZED
Code:
stack=5, locals=3, args_size=2
start local 0 start local 1 0: lload 1
lconst_0
lcmp
ifge 2
1: new java.lang.IllegalArgumentException
dup
new java.lang.StringBuilder
dup
ldc "negative new position: "
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
lload 1
invokevirtual java.lang.StringBuilder.append:(J)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
invokespecial java.lang.IllegalArgumentException.<init>:(Ljava/lang/String;)V
athrow
2: StackMap locals:
StackMap stack:
lload 1
ldc 2147483647
lcmp
ifle 4
3: new java.lang.IllegalArgumentException
dup
new java.lang.StringBuilder
dup
ldc "can not set new position: "
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
lload 1
invokevirtual java.lang.StringBuilder.append:(J)Ljava/lang/StringBuilder;
ldc " too big!"
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
invokespecial java.lang.IllegalArgumentException.<init>:(Ljava/lang/String;)V
athrow
4: StackMap locals:
StackMap stack:
aload 0
getfield org.jruby.util.io.SeekableByteChannelImpl.in:Ljava/io/ByteArrayInputStream;
invokevirtual java.io.ByteArrayInputStream.reset:()V
5: lload 1
lconst_0
lcmp
ifle 6
aload 0
getfield org.jruby.util.io.SeekableByteChannelImpl.in:Ljava/io/ByteArrayInputStream;
lload 1
invokevirtual java.io.ByteArrayInputStream.skip:(J)J
pop2
6: StackMap locals:
StackMap stack:
aload 0
areturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 7 0 this Lorg/jruby/util/io/SeekableByteChannelImpl;
0 7 1 newPosition J
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
newPosition
public long size();
descriptor: ()J
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=1, args_size=1
start local 0 0: aload 0
getfield org.jruby.util.io.SeekableByteChannelImpl.count:I
aload 0
getfield org.jruby.util.io.SeekableByteChannelImpl.truncatedBy:I
isub
iconst_0
invokestatic java.lang.Math.max:(II)I
i2l
lreturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lorg/jruby/util/io/SeekableByteChannelImpl;
public java.nio.channels.SeekableByteChannel truncate(long);
descriptor: (J)Ljava/nio/channels/SeekableByteChannel;
flags: (0x0001) ACC_PUBLIC
Code:
stack=5, locals=4, args_size=2
start local 0 start local 1 0: lload 1
lconst_0
lcmp
ifge 2
1: new java.lang.IllegalArgumentException
dup
new java.lang.StringBuilder
dup
ldc "negative truncate size given: "
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
lload 1
invokevirtual java.lang.StringBuilder.append:(J)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
invokespecial java.lang.IllegalArgumentException.<init>:(Ljava/lang/String;)V
athrow
2: StackMap locals:
StackMap stack:
aload 0
invokevirtual org.jruby.util.io.SeekableByteChannelImpl.size:()J
l2i
lload 1
ldc 2147483647
lcmp
ifle 3
ldc 2147483647
goto 4
StackMap locals:
StackMap stack: int
3: lload 1
l2i
StackMap locals: org.jruby.util.io.SeekableByteChannelImpl long
StackMap stack: int int
4: invokestatic java.lang.Math.min:(II)I
istore 3
start local 3 5: aload 0
dup
getfield org.jruby.util.io.SeekableByteChannelImpl.truncatedBy:I
iload 3
iadd
putfield org.jruby.util.io.SeekableByteChannelImpl.truncatedBy:I
6: aload 0
areturn
end local 3 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 7 0 this Lorg/jruby/util/io/SeekableByteChannelImpl;
0 7 1 size J
5 7 3 s I
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
size
public int write(java.nio.ByteBuffer);
descriptor: (Ljava/nio/ByteBuffer;)I
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=2, args_size=2
start local 0 start local 1 0: new java.lang.UnsupportedOperationException
dup
ldc "write not supported"
invokespecial java.lang.UnsupportedOperationException.<init>:(Ljava/lang/String;)V
athrow
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lorg/jruby/util/io/SeekableByteChannelImpl;
0 1 1 src Ljava/nio/ByteBuffer;
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
src
private static int pos(java.io.ByteArrayInputStream);
descriptor: (Ljava/io/ByteArrayInputStream;)I
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=2, locals=1, args_size=1
start local 0 0: aload 0
getstatic org.jruby.util.io.SeekableByteChannelImpl.posField:Ljava/lang/reflect/Field;
invokestatic org.jruby.util.io.SeekableByteChannelImpl.readIntField:(Ljava/io/ByteArrayInputStream;Ljava/lang/reflect/Field;)I
ireturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 in Ljava/io/ByteArrayInputStream;
MethodParameters:
Name Flags
in
private static int count(java.io.ByteArrayInputStream);
descriptor: (Ljava/io/ByteArrayInputStream;)I
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=2, locals=1, args_size=1
start local 0 0: aload 0
getstatic org.jruby.util.io.SeekableByteChannelImpl.countField:Ljava/lang/reflect/Field;
invokestatic org.jruby.util.io.SeekableByteChannelImpl.readIntField:(Ljava/io/ByteArrayInputStream;Ljava/lang/reflect/Field;)I
ireturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 in Ljava/io/ByteArrayInputStream;
MethodParameters:
Name Flags
in
private static int mark(java.io.ByteArrayInputStream);
descriptor: (Ljava/io/ByteArrayInputStream;)I
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=2, locals=1, args_size=1
start local 0 0: aload 0
getstatic org.jruby.util.io.SeekableByteChannelImpl.markField:Ljava/lang/reflect/Field;
invokestatic org.jruby.util.io.SeekableByteChannelImpl.readIntField:(Ljava/io/ByteArrayInputStream;Ljava/lang/reflect/Field;)I
ireturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 in Ljava/io/ByteArrayInputStream;
MethodParameters:
Name Flags
in
private static int readIntField(java.io.ByteArrayInputStream, java.lang.reflect.Field);
descriptor: (Ljava/io/ByteArrayInputStream;Ljava/lang/reflect/Field;)I
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=3, locals=3, args_size=2
start local 0 start local 1 0: aload 1
aload 0
invokevirtual java.lang.reflect.Field.getInt:(Ljava/lang/Object;)I
1: ireturn
2: StackMap locals:
StackMap stack: java.lang.IllegalAccessException
astore 2
start local 2 3: new java.lang.IllegalStateException
dup
aload 2
invokespecial java.lang.IllegalStateException.<init>:(Ljava/lang/Throwable;)V
athrow
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 4 0 self Ljava/io/ByteArrayInputStream;
0 4 1 field Ljava/lang/reflect/Field;
3 4 2 ex Ljava/lang/IllegalAccessException;
Exception table:
from to target type
0 1 2 Class java.lang.IllegalAccessException
MethodParameters:
Name Flags
self
field
private static java.lang.reflect.Field accessibleField(java.lang.String);
descriptor: (Ljava/lang/String;)Ljava/lang/reflect/Field;
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=2, locals=2, args_size=1
start local 0 0: ldc Ljava/io/ByteArrayInputStream;
aload 0
invokevirtual java.lang.Class.getDeclaredField:(Ljava/lang/String;)Ljava/lang/reflect/Field;
astore 1
start local 1 1: aload 1
iconst_1
invokevirtual java.lang.reflect.Field.setAccessible:(Z)V
2: aload 1
3: areturn
end local 1 4: StackMap locals:
StackMap stack: java.lang.NoSuchFieldException
pop
5: aconst_null
areturn
6: StackMap locals:
StackMap stack: java.lang.SecurityException
pop
7: aconst_null
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 8 0 name Ljava/lang/String;
1 4 1 field Ljava/lang/reflect/Field;
Exception table:
from to target type
0 3 4 Class java.lang.NoSuchFieldException
0 3 6 Class java.lang.SecurityException
MethodParameters:
Name Flags
name final
}
SourceFile: "SeekableByteChannelImpl.java"