public final class org.apache.commons.io.input.BufferedFileChannelInputStream extends java.io.InputStream
{
private final java.nio.ByteBuffer byteBuffer;
private final java.nio.channels.FileChannel fileChannel;
private static final java.lang.Class DIRECT_BUFFER_CLASS;
private static java.lang.Class getDirectBufferClass()
{
java.lang.Throwable v;
java.lang.Class v;
v = null;
label:
v = staticinvoke <java.lang.Class: java.lang.Class forName(java.lang.String)>("sun.nio.ch.DirectBuffer");
label:
goto label;
label:
v := @caughtexception;
label:
return v;
catch java.lang.IllegalAccessError from label to label with label;
catch java.lang.ClassNotFoundException from label to label with label;
}
private static boolean isDirectBuffer(java.lang.Object)
{
java.lang.Class v, v;
java.lang.Object v;
boolean v, v;
v := @parameter: java.lang.Object;
v = <org.apache.commons.io.input.BufferedFileChannelInputStream: java.lang.Class DIRECT_BUFFER_CLASS>;
if v == null goto label;
v = <org.apache.commons.io.input.BufferedFileChannelInputStream: java.lang.Class DIRECT_BUFFER_CLASS>;
v = virtualinvoke v.<java.lang.Class: boolean isInstance(java.lang.Object)>(v);
if v == 0 goto label;
v = 1;
goto label;
label:
v = 0;
label:
return v;
}
public void <init>(java.io.File) throws java.io.IOException
{
org.apache.commons.io.input.BufferedFileChannelInputStream v;
java.io.File v;
v := @this: org.apache.commons.io.input.BufferedFileChannelInputStream;
v := @parameter: java.io.File;
specialinvoke v.<org.apache.commons.io.input.BufferedFileChannelInputStream: void <init>(java.io.File,int)>(v, 8192);
return;
}
public void <init>(java.io.File, int) throws java.io.IOException
{
org.apache.commons.io.input.BufferedFileChannelInputStream v;
int v;
java.nio.file.Path v;
java.io.File v;
v := @this: org.apache.commons.io.input.BufferedFileChannelInputStream;
v := @parameter: java.io.File;
v := @parameter: int;
v = virtualinvoke v.<java.io.File: java.nio.file.Path toPath()>();
specialinvoke v.<org.apache.commons.io.input.BufferedFileChannelInputStream: void <init>(java.nio.file.Path,int)>(v, v);
return;
}
public void <init>(java.nio.file.Path) throws java.io.IOException
{
org.apache.commons.io.input.BufferedFileChannelInputStream v;
java.nio.file.Path v;
v := @this: org.apache.commons.io.input.BufferedFileChannelInputStream;
v := @parameter: java.nio.file.Path;
specialinvoke v.<org.apache.commons.io.input.BufferedFileChannelInputStream: void <init>(java.nio.file.Path,int)>(v, 8192);
return;
}
public void <init>(java.nio.file.Path, int) throws java.io.IOException
{
org.apache.commons.io.input.BufferedFileChannelInputStream v;
java.nio.file.StandardOpenOption v;
java.nio.ByteBuffer v, v;
java.nio.file.OpenOption[] v;
int v;
java.nio.channels.FileChannel v;
java.nio.file.Path v;
v := @this: org.apache.commons.io.input.BufferedFileChannelInputStream;
v := @parameter: java.nio.file.Path;
v := @parameter: int;
specialinvoke v.<java.io.InputStream: void <init>()>();
staticinvoke <java.util.Objects: java.lang.Object requireNonNull(java.lang.Object,java.lang.String)>(v, "path");
v = newarray (java.nio.file.OpenOption)[1];
v = <java.nio.file.StandardOpenOption: java.nio.file.StandardOpenOption READ>;
v[0] = v;
v = staticinvoke <java.nio.channels.FileChannel: java.nio.channels.FileChannel open(java.nio.file.Path,java.nio.file.OpenOption[])>(v, v);
v.<org.apache.commons.io.input.BufferedFileChannelInputStream: java.nio.channels.FileChannel fileChannel> = v;
v = staticinvoke <java.nio.ByteBuffer: java.nio.ByteBuffer allocateDirect(int)>(v);
v.<org.apache.commons.io.input.BufferedFileChannelInputStream: java.nio.ByteBuffer byteBuffer> = v;
v = v.<org.apache.commons.io.input.BufferedFileChannelInputStream: java.nio.ByteBuffer byteBuffer>;
virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer flip()>();
return;
}
public synchronized int available() throws java.io.IOException
{
int v;
org.apache.commons.io.input.BufferedFileChannelInputStream v;
java.nio.ByteBuffer v;
v := @this: org.apache.commons.io.input.BufferedFileChannelInputStream;
v = v.<org.apache.commons.io.input.BufferedFileChannelInputStream: java.nio.ByteBuffer byteBuffer>;
v = virtualinvoke v.<java.nio.ByteBuffer: int remaining()>();
return v;
}
private void clean(java.nio.ByteBuffer)
{
org.apache.commons.io.input.BufferedFileChannelInputStream v;
java.nio.ByteBuffer v;
boolean v;
v := @this: org.apache.commons.io.input.BufferedFileChannelInputStream;
v := @parameter: java.nio.ByteBuffer;
v = staticinvoke <org.apache.commons.io.input.BufferedFileChannelInputStream: boolean isDirectBuffer(java.lang.Object)>(v);
if v == 0 goto label;
specialinvoke v.<org.apache.commons.io.input.BufferedFileChannelInputStream: void cleanDirectBuffer(java.nio.ByteBuffer)>(v);
label:
return;
}
private void cleanDirectBuffer(java.nio.ByteBuffer)
{
java.lang.IllegalStateException v, v;
java.lang.Object[] v, v, v;
java.lang.ReflectiveOperationException v, v;
java.nio.ByteBuffer v;
java.lang.String v, v;
java.lang.reflect.Method v, v, v;
boolean v;
org.apache.commons.io.input.BufferedFileChannelInputStream v;
java.lang.Class[] v, v, v;
java.lang.reflect.Field v;
java.lang.Class v, v, v;
java.lang.Object v, v;
v := @this: org.apache.commons.io.input.BufferedFileChannelInputStream;
v := @parameter: java.nio.ByteBuffer;
v = staticinvoke <java.lang.System: java.lang.String getProperty(java.lang.String)>("java.specification.version");
v = "1.8";
v = virtualinvoke v.<java.lang.String: boolean equals(java.lang.Object)>(v);
if v == 0 goto label;
label:
v = staticinvoke <java.lang.Class: java.lang.Class forName(java.lang.String)>("sun.misc.Cleaner");
v = <org.apache.commons.io.input.BufferedFileChannelInputStream: java.lang.Class DIRECT_BUFFER_CLASS>;
v = newarray (java.lang.Class)[0];
v = virtualinvoke v.<java.lang.Class: java.lang.reflect.Method getMethod(java.lang.String,java.lang.Class[])>("cleaner", v);
v = newarray (java.lang.Object)[0];
v = virtualinvoke v.<java.lang.reflect.Method: java.lang.Object invoke(java.lang.Object,java.lang.Object[])>(v, v);
if v == null goto label;
v = newarray (java.lang.Class)[0];
v = virtualinvoke v.<java.lang.Class: java.lang.reflect.Method getMethod(java.lang.String,java.lang.Class[])>("clean", v);
v = newarray (java.lang.Object)[0];
virtualinvoke v.<java.lang.reflect.Method: java.lang.Object invoke(java.lang.Object,java.lang.Object[])>(v, v);
label:
goto label;
label:
v := @caughtexception;
v = new java.lang.IllegalStateException;
specialinvoke v.<java.lang.IllegalStateException: void <init>(java.lang.Throwable)>(v);
throw v;
label:
v = staticinvoke <java.lang.Class: java.lang.Class forName(java.lang.String)>("sun.misc.Unsafe");
v = newarray (java.lang.Class)[1];
v[0] = class "Ljava/nio/ByteBuffer;";
v = virtualinvoke v.<java.lang.Class: java.lang.reflect.Method getMethod(java.lang.String,java.lang.Class[])>("invokeCleaner", v);
v = virtualinvoke v.<java.lang.Class: java.lang.reflect.Field getDeclaredField(java.lang.String)>("theUnsafe");
virtualinvoke v.<java.lang.reflect.Field: void setAccessible(boolean)>(1);
v = virtualinvoke v.<java.lang.reflect.Field: java.lang.Object get(java.lang.Object)>(null);
v = newarray (java.lang.Object)[1];
v[0] = v;
virtualinvoke v.<java.lang.reflect.Method: java.lang.Object invoke(java.lang.Object,java.lang.Object[])>(v, v);
label:
goto label;
label:
v := @caughtexception;
v = new java.lang.IllegalStateException;
specialinvoke v.<java.lang.IllegalStateException: void <init>(java.lang.Throwable)>(v);
throw v;
label:
return;
catch java.lang.ReflectiveOperationException from label to label with label;
catch java.lang.ReflectiveOperationException from label to label with label;
}
public synchronized void close() throws java.io.IOException
{
java.lang.Throwable v;
org.apache.commons.io.input.BufferedFileChannelInputStream v;
java.nio.channels.FileChannel v;
java.nio.ByteBuffer v, v;
v := @this: org.apache.commons.io.input.BufferedFileChannelInputStream;
label:
v = v.<org.apache.commons.io.input.BufferedFileChannelInputStream: java.nio.channels.FileChannel fileChannel>;
virtualinvoke v.<java.nio.channels.FileChannel: void close()>();
label:
v = v.<org.apache.commons.io.input.BufferedFileChannelInputStream: java.nio.ByteBuffer byteBuffer>;
specialinvoke v.<org.apache.commons.io.input.BufferedFileChannelInputStream: void clean(java.nio.ByteBuffer)>(v);
goto label;
label:
v := @caughtexception;
v = v.<org.apache.commons.io.input.BufferedFileChannelInputStream: java.nio.ByteBuffer byteBuffer>;
specialinvoke v.<org.apache.commons.io.input.BufferedFileChannelInputStream: void clean(java.nio.ByteBuffer)>(v);
throw v;
label:
return;
catch java.lang.Throwable from label to label with label;
}
public synchronized int read() throws java.io.IOException
{
short v;
org.apache.commons.io.input.BufferedFileChannelInputStream v;
byte v;
int v;
java.nio.ByteBuffer v;
boolean v;
v := @this: org.apache.commons.io.input.BufferedFileChannelInputStream;
v = specialinvoke v.<org.apache.commons.io.input.BufferedFileChannelInputStream: boolean refill()>();
if v != 0 goto label;
v = (int) -1;
return v;
label:
v = v.<org.apache.commons.io.input.BufferedFileChannelInputStream: java.nio.ByteBuffer byteBuffer>;
v = virtualinvoke v.<java.nio.ByteBuffer: byte get()>();
v = v & 255;
return v;
}
public synchronized int read(byte[], int, int) throws java.io.IOException
{
byte[] v;
java.lang.IndexOutOfBoundsException v;
org.apache.commons.io.input.BufferedFileChannelInputStream v;
java.nio.ByteBuffer v, v;
int v, v, v, v, v, v, v, v;
boolean v;
v := @this: org.apache.commons.io.input.BufferedFileChannelInputStream;
v := @parameter: byte[];
v := @parameter: int;
v := @parameter: int;
if v < 0 goto label;
if v < 0 goto label;
v = v + v;
if v < 0 goto label;
v = v + v;
v = lengthof v;
if v <= v goto label;
label:
v = new java.lang.IndexOutOfBoundsException;
specialinvoke v.<java.lang.IndexOutOfBoundsException: void <init>()>();
throw v;
label:
v = specialinvoke v.<org.apache.commons.io.input.BufferedFileChannelInputStream: boolean refill()>();
if v != 0 goto label;
v = (int) -1;
return v;
label:
v = v.<org.apache.commons.io.input.BufferedFileChannelInputStream: java.nio.ByteBuffer byteBuffer>;
v = virtualinvoke v.<java.nio.ByteBuffer: int remaining()>();
v = staticinvoke <java.lang.Math: int min(int,int)>(v, v);
v = v.<org.apache.commons.io.input.BufferedFileChannelInputStream: java.nio.ByteBuffer byteBuffer>;
virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer get(byte[],int,int)>(v, v, v);
return v;
}
private boolean refill() throws java.io.IOException
{
org.apache.commons.io.input.BufferedFileChannelInputStream v;
java.nio.ByteBuffer v, v, v, v;
int v;
java.nio.channels.FileChannel v;
boolean v, v;
v := @this: org.apache.commons.io.input.BufferedFileChannelInputStream;
v = v.<org.apache.commons.io.input.BufferedFileChannelInputStream: java.nio.ByteBuffer byteBuffer>;
v = virtualinvoke v.<java.nio.ByteBuffer: boolean hasRemaining()>();
if v != 0 goto label;
v = v.<org.apache.commons.io.input.BufferedFileChannelInputStream: java.nio.ByteBuffer byteBuffer>;
virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer clear()>();
v = 0;
label:
if v != 0 goto label;
v = v.<org.apache.commons.io.input.BufferedFileChannelInputStream: java.nio.channels.FileChannel fileChannel>;
v = v.<org.apache.commons.io.input.BufferedFileChannelInputStream: java.nio.ByteBuffer byteBuffer>;
v = virtualinvoke v.<java.nio.channels.FileChannel: int read(java.nio.ByteBuffer)>(v);
goto label;
label:
v = v.<org.apache.commons.io.input.BufferedFileChannelInputStream: java.nio.ByteBuffer byteBuffer>;
virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer flip()>();
if v < 0 goto label;
v = 1;
goto label;
label:
v = 0;
label:
return v;
label:
return 1;
}
public synchronized long skip(long) throws java.io.IOException
{
long v, v, v, v;
java.nio.ByteBuffer v, v, v, v, v, v;
byte v, v;
int v, v, v, v;
org.apache.commons.io.input.BufferedFileChannelInputStream v;
v := @this: org.apache.commons.io.input.BufferedFileChannelInputStream;
v := @parameter: long;
v = v cmp 0L;
if v > 0 goto label;
return 0L;
label:
v = v.<org.apache.commons.io.input.BufferedFileChannelInputStream: java.nio.ByteBuffer byteBuffer>;
v = virtualinvoke v.<java.nio.ByteBuffer: int remaining()>();
v = v cmp v;
if v < 0 goto label;
v = v.<org.apache.commons.io.input.BufferedFileChannelInputStream: java.nio.ByteBuffer byteBuffer>;
v = v.<org.apache.commons.io.input.BufferedFileChannelInputStream: java.nio.ByteBuffer byteBuffer>;
v = virtualinvoke v.<java.nio.ByteBuffer: int position()>();
v = v + v;
virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer position(int)>(v);
return v;
label:
v = v.<org.apache.commons.io.input.BufferedFileChannelInputStream: java.nio.ByteBuffer byteBuffer>;
v = virtualinvoke v.<java.nio.ByteBuffer: int remaining()>();
v = v - v;
v = v.<org.apache.commons.io.input.BufferedFileChannelInputStream: java.nio.ByteBuffer byteBuffer>;
virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer position(int)>(0);
v = v.<org.apache.commons.io.input.BufferedFileChannelInputStream: java.nio.ByteBuffer byteBuffer>;
virtualinvoke v.<java.nio.ByteBuffer: java.nio.ByteBuffer flip()>();
v = specialinvoke v.<org.apache.commons.io.input.BufferedFileChannelInputStream: long skipFromFileChannel(long)>(v);
v = v + v;
return v;
}
private long skipFromFileChannel(long) throws java.io.IOException
{
org.apache.commons.io.input.BufferedFileChannelInputStream v;
long v, v, v, v, v, v;
byte v;
java.nio.channels.FileChannel v, v, v, v;
v := @this: org.apache.commons.io.input.BufferedFileChannelInputStream;
v := @parameter: long;
v = v.<org.apache.commons.io.input.BufferedFileChannelInputStream: java.nio.channels.FileChannel fileChannel>;
v = virtualinvoke v.<java.nio.channels.FileChannel: long position()>();
v = v.<org.apache.commons.io.input.BufferedFileChannelInputStream: java.nio.channels.FileChannel fileChannel>;
v = virtualinvoke v.<java.nio.channels.FileChannel: long size()>();
v = v - v;
v = v cmp v;
if v <= 0 goto label;
v = v.<org.apache.commons.io.input.BufferedFileChannelInputStream: java.nio.channels.FileChannel fileChannel>;
virtualinvoke v.<java.nio.channels.FileChannel: java.nio.channels.FileChannel position(long)>(v);
v = v - v;
return v;
label:
v = v.<org.apache.commons.io.input.BufferedFileChannelInputStream: java.nio.channels.FileChannel fileChannel>;
v = v + v;
virtualinvoke v.<java.nio.channels.FileChannel: java.nio.channels.FileChannel position(long)>(v);
return v;
}
static void <clinit>()
{
java.lang.Class v;
v = staticinvoke <org.apache.commons.io.input.BufferedFileChannelInputStream: java.lang.Class getDirectBufferClass()>();
<org.apache.commons.io.input.BufferedFileChannelInputStream: java.lang.Class DIRECT_BUFFER_CLASS> = v;
return;
}
}