public final class com.google.common.io.ByteStreams extends java.lang.Object
{
private static final int BUFFER_SIZE;
private static final int ZERO_COPY_CHUNK_SIZE;
private static final int MAX_ARRAY_LEN;
private static final int TO_BYTE_ARRAY_DEQUE_SIZE;
private static final java.io.OutputStream NULL_OUTPUT_STREAM;
static byte[] createBuffer()
{
byte[] v;
v = newarray (byte)[8192];
return v;
}
private void <init>()
{
com.google.common.io.ByteStreams v;
v := @this: com.google.common.io.ByteStreams;
specialinvoke v.<java.lang.Object: void <init>()>();
return;
}
public static long copy(java.io.InputStream, java.io.OutputStream) throws java.io.IOException
{
java.io.OutputStream v;
byte[] v;
int v, v;
long v;
java.io.InputStream v;
v := @parameter: java.io.InputStream;
v := @parameter: java.io.OutputStream;
staticinvoke <com.google.common.base.Preconditions: java.lang.Object checkNotNull(java.lang.Object)>(v);
staticinvoke <com.google.common.base.Preconditions: java.lang.Object checkNotNull(java.lang.Object)>(v);
v = staticinvoke <com.google.common.io.ByteStreams: byte[] createBuffer()>();
v = 0L;
label:
v = virtualinvoke v.<java.io.InputStream: int read(byte[])>(v);
v = (int) -1;
if v == v goto label;
virtualinvoke v.<java.io.OutputStream: void write(byte[],int,int)>(v, 0, v);
v = v + v;
goto label;
label:
return v;
}
public static long copy(java.nio.channels.ReadableByteChannel, java.nio.channels.WritableByteChannel) throws java.io.IOException
{
byte[] v;
long v, v, v, v, v, v;
java.nio.ByteBuffer v;
byte v, v;
int v, v, v;
boolean v, v;
java.nio.channels.ReadableByteChannel v;
java.nio.channels.WritableByteChannel v;
v := @parameter: java.nio.channels.ReadableByteChannel;
v := @parameter: java.nio.channels.WritableByteChannel;
staticinvoke <com.google.common.base.Preconditions: java.lang.Object checkNotNull(java.lang.Object)>(v);
staticinvoke <com.google.common.base.Preconditions: java.lang.Object checkNotNull(java.lang.Object)>(v);
v = v instanceof java.nio.channels.FileChannel;
if v == 0 goto label;
v = virtualinvoke v.<java.nio.channels.FileChannel: long position()>();
v = v;
label:
v = virtualinvoke v.<java.nio.channels.FileChannel: long transferTo(long,long,java.nio.channels.WritableByteChannel)>(v, 524288L, v);
v = v + v;
virtualinvoke v.<java.nio.channels.FileChannel: java.nio.channels.FileChannel position(long)>(v);
v = v cmp 0L;
if v > 0 goto label;
v = virtualinvoke v.<java.nio.channels.FileChannel: long size()>();
v = v cmp v;
if v < 0 goto label;
v = v - v;
return v;
label:
v = staticinvoke <com.google.common.io.ByteStreams: byte[] createBuffer()>();
v = staticinvoke <java.nio.ByteBuffer: java.nio.ByteBuffer wrap(byte[])>(v);
v = 0L;
label:
v = interfaceinvoke v.<java.nio.channels.ReadableByteChannel: int read(java.nio.ByteBuffer)>(v);
v = (int) -1;
if v == v goto label;
staticinvoke <com.google.common.io.Java8Compatibility: void flip(java.nio.Buffer)>(v);
label:
v = virtualinvoke v.<java.nio.ByteBuffer: boolean hasRemaining()>();
if v == 0 goto label;
v = interfaceinvoke v.<java.nio.channels.WritableByteChannel: int write(java.nio.ByteBuffer)>(v);
v = v + v;
goto label;
label:
staticinvoke <com.google.common.io.Java8Compatibility: void clear(java.nio.Buffer)>(v);
goto label;
label:
return v;
}
private static byte[] toByteArrayInternal(java.io.InputStream, java.util.Queue, int) throws java.io.IOException
{
byte[] v, v, v;
int v, v, v, v, v, v, v, v, v, v, v, v;
java.util.Queue v;
java.lang.OutOfMemoryError v;
java.io.InputStream v;
v := @parameter: java.io.InputStream;
v := @parameter: java.util.Queue;
v := @parameter: int;
v = 8192;
label:
if v >= 2147483639 goto label;
v = 2147483639 - v;
v = staticinvoke <java.lang.Math: int min(int,int)>(v, v);
v = newarray (byte)[v];
interfaceinvoke v.<java.util.Queue: boolean add(java.lang.Object)>(v);
v = 0;
label:
v = lengthof v;
if v >= v goto label;
v = lengthof v;
v = v - v;
v = virtualinvoke v.<java.io.InputStream: int read(byte[],int,int)>(v, v, v);
v = (int) -1;
if v != v goto label;
v = staticinvoke <com.google.common.io.ByteStreams: byte[] combineBuffers(java.util.Queue,int)>(v, v);
return v;
label:
v = v + v;
v = v + v;
goto label;
label:
v = staticinvoke <com.google.common.math.IntMath: int saturatedMultiply(int,int)>(v, 2);
goto label;
label:
v = virtualinvoke v.<java.io.InputStream: int read()>();
v = (int) -1;
if v != v goto label;
v = staticinvoke <com.google.common.io.ByteStreams: byte[] combineBuffers(java.util.Queue,int)>(v, 2147483639);
return v;
label:
v = new java.lang.OutOfMemoryError;
specialinvoke v.<java.lang.OutOfMemoryError: void <init>(java.lang.String)>("input is too large to fit in a byte array");
throw v;
}
private static byte[] combineBuffers(java.util.Queue, int)
{
byte[] v;
int v, v, v, v, v;
java.lang.Object v;
java.util.Queue v;
v := @parameter: java.util.Queue;
v := @parameter: int;
v = newarray (byte)[v];
v = v;
label:
if v <= 0 goto label;
v = interfaceinvoke v.<java.util.Queue: java.lang.Object remove()>();
v = lengthof v;
v = staticinvoke <java.lang.Math: int min(int,int)>(v, v);
v = v - v;
staticinvoke <java.lang.System: void arraycopy(java.lang.Object,int,java.lang.Object,int,int)>(v, 0, v, v, v);
v = v - v;
goto label;
label:
return v;
}
public static byte[] toByteArray(java.io.InputStream) throws java.io.IOException
{
byte[] v;
java.util.ArrayDeque v;
java.io.InputStream v;
v := @parameter: java.io.InputStream;
staticinvoke <com.google.common.base.Preconditions: java.lang.Object checkNotNull(java.lang.Object)>(v);
v = new java.util.ArrayDeque;
specialinvoke v.<java.util.ArrayDeque: void <init>(int)>(20);
v = staticinvoke <com.google.common.io.ByteStreams: byte[] toByteArrayInternal(java.io.InputStream,java.util.Queue,int)>(v, v, 0);
return v;
}
static byte[] toByteArray(java.io.InputStream, long) throws java.io.IOException
{
byte[] v, v, v, v;
long v;
byte v, v;
int v, v, v, v, v, v, v;
java.lang.String v;
boolean v;
java.lang.StringBuilder v;
java.util.ArrayDeque v;
java.lang.OutOfMemoryError v;
java.io.InputStream v;
v := @parameter: java.io.InputStream;
v := @parameter: long;
v = v cmp 0L;
if v < 0 goto label;
v = 1;
goto label;
label:
v = 0;
label:
staticinvoke <com.google.common.base.Preconditions: void checkArgument(boolean,java.lang.String,long)>(v, "expectedSize (%s) must be non-negative", v);
v = v cmp 2147483639L;
if v <= 0 goto label;
v = new java.lang.OutOfMemoryError;
specialinvoke v.<java.lang.StringBuilder: void <init>(int)>(62);
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (long)>(v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("\u bytes is too large to fit in a byte array");
specialinvoke v.<java.lang.OutOfMemoryError: void <init>(java.lang.String)>(v);
throw v;
label:
v = newarray (byte)[v];
label:
if v <= 0 goto label;
v = v - v;
v = virtualinvoke v.<java.io.InputStream: int read(byte[],int,int)>(v, v, v);
v = (int) -1;
if v != v goto label;
v = staticinvoke <java.util.Arrays: byte[] copyOf(byte[],int)>(v, v);
return v;
label:
v = v - v;
goto label;
label:
v = virtualinvoke v.<java.io.InputStream: int read()>();
v = (int) -1;
if v != v goto label;
return v;
label:
v = new java.util.ArrayDeque;
specialinvoke v.<java.util.ArrayDeque: void <init>(int)>(22);
interfaceinvoke v.<java.util.Queue: boolean add(java.lang.Object)>(v);
v = newarray (byte)[1];
v[0] = v;
interfaceinvoke v.<java.util.Queue: boolean add(java.lang.Object)>(v);
v = lengthof v;
v = v + 1;
v = staticinvoke <com.google.common.io.ByteStreams: byte[] toByteArrayInternal(java.io.InputStream,java.util.Queue,int)>(v, v, v);
return v;
}
public static long exhaust(java.io.InputStream) throws java.io.IOException
{
byte[] v;
byte v;
int v;
long v;
java.io.InputStream v;
v := @parameter: java.io.InputStream;
v = 0L;
v = staticinvoke <com.google.common.io.ByteStreams: byte[] createBuffer()>();
label:
v = virtualinvoke v.<java.io.InputStream: int read(byte[])>(v);
v = v cmp -1L;
if v == 0 goto label;
v = v + v;
goto label;
label:
return v;
}
public static com.google.common.io.ByteArrayDataInput newDataInput(byte[])
{
com.google.common.io.ByteArrayDataInput v;
byte[] v;
java.io.ByteArrayInputStream v;
v := @parameter: byte[];
v = new java.io.ByteArrayInputStream;
specialinvoke v.<java.io.ByteArrayInputStream: void <init>(byte[])>(v);
v = staticinvoke <com.google.common.io.ByteStreams: com.google.common.io.ByteArrayDataInput newDataInput(java.io.ByteArrayInputStream)>(v);
return v;
}
public static com.google.common.io.ByteArrayDataInput newDataInput(byte[], int)
{
byte[] v;
java.io.ByteArrayInputStream v;
com.google.common.io.ByteArrayDataInput v;
int v, v, v, v;
v := @parameter: byte[];
v := @parameter: int;
v = lengthof v;
staticinvoke <com.google.common.base.Preconditions: int checkPositionIndex(int,int)>(v, v);
v = new java.io.ByteArrayInputStream;
v = lengthof v;
v = v - v;
specialinvoke v.<java.io.ByteArrayInputStream: void <init>(byte[],int,int)>(v, v, v);
v = staticinvoke <com.google.common.io.ByteStreams: com.google.common.io.ByteArrayDataInput newDataInput(java.io.ByteArrayInputStream)>(v);
return v;
}
public static com.google.common.io.ByteArrayDataInput newDataInput(java.io.ByteArrayInputStream)
{
com.google.common.io.ByteStreams$ByteArrayDataInputStream v;
java.lang.Object v;
java.io.ByteArrayInputStream v;
v := @parameter: java.io.ByteArrayInputStream;
v = new com.google.common.io.ByteStreams$ByteArrayDataInputStream;
v = staticinvoke <com.google.common.base.Preconditions: java.lang.Object checkNotNull(java.lang.Object)>(v);
specialinvoke v.<com.google.common.io.ByteStreams$ByteArrayDataInputStream: void <init>(java.io.ByteArrayInputStream)>(v);
return v;
}
public static com.google.common.io.ByteArrayDataOutput newDataOutput()
{
java.io.ByteArrayOutputStream v;
com.google.common.io.ByteArrayDataOutput v;
v = new java.io.ByteArrayOutputStream;
specialinvoke v.<java.io.ByteArrayOutputStream: void <init>()>();
v = staticinvoke <com.google.common.io.ByteStreams: com.google.common.io.ByteArrayDataOutput newDataOutput(java.io.ByteArrayOutputStream)>(v);
return v;
}
public static com.google.common.io.ByteArrayDataOutput newDataOutput(int)
{
java.lang.Object[] v;
java.io.ByteArrayOutputStream v;
int v;
java.lang.String v;
java.lang.IllegalArgumentException v;
java.lang.Integer v;
com.google.common.io.ByteArrayDataOutput v;
v := @parameter: int;
if v >= 0 goto label;
v = new java.lang.IllegalArgumentException;
v = newarray (java.lang.Object)[1];
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
v[0] = v;
v = staticinvoke <java.lang.String: java.lang.String format(java.lang.String,java.lang.Object[])>("Invalid size: %s", v);
specialinvoke v.<java.lang.IllegalArgumentException: void <init>(java.lang.String)>(v);
throw v;
label:
v = new java.io.ByteArrayOutputStream;
specialinvoke v.<java.io.ByteArrayOutputStream: void <init>(int)>(v);
v = staticinvoke <com.google.common.io.ByteStreams: com.google.common.io.ByteArrayDataOutput newDataOutput(java.io.ByteArrayOutputStream)>(v);
return v;
}
public static com.google.common.io.ByteArrayDataOutput newDataOutput(java.io.ByteArrayOutputStream)
{
java.lang.Object v;
java.io.ByteArrayOutputStream v;
com.google.common.io.ByteStreams$ByteArrayDataOutputStream v;
v := @parameter: java.io.ByteArrayOutputStream;
v = new com.google.common.io.ByteStreams$ByteArrayDataOutputStream;
v = staticinvoke <com.google.common.base.Preconditions: java.lang.Object checkNotNull(java.lang.Object)>(v);
specialinvoke v.<com.google.common.io.ByteStreams$ByteArrayDataOutputStream: void <init>(java.io.ByteArrayOutputStream)>(v);
return v;
}
public static java.io.OutputStream nullOutputStream()
{
java.io.OutputStream v;
v = <com.google.common.io.ByteStreams: java.io.OutputStream NULL_OUTPUT_STREAM>;
return v;
}
public static java.io.InputStream limit(java.io.InputStream, long)
{
long v;
com.google.common.io.ByteStreams$LimitedInputStream v;
java.io.InputStream v;
v := @parameter: java.io.InputStream;
v := @parameter: long;
v = new com.google.common.io.ByteStreams$LimitedInputStream;
specialinvoke v.<com.google.common.io.ByteStreams$LimitedInputStream: void <init>(java.io.InputStream,long)>(v, v);
return v;
}
public static void readFully(java.io.InputStream, byte[]) throws java.io.IOException
{
int v;
byte[] v;
java.io.InputStream v;
v := @parameter: java.io.InputStream;
v := @parameter: byte[];
v = lengthof v;
staticinvoke <com.google.common.io.ByteStreams: void readFully(java.io.InputStream,byte[],int,int)>(v, v, 0, v);
return;
}
public static void readFully(java.io.InputStream, byte[], int, int) throws java.io.IOException
{
byte[] v;
java.io.EOFException v;
int v, v, v;
java.lang.StringBuilder v;
java.lang.String v;
java.io.InputStream v;
v := @parameter: java.io.InputStream;
v := @parameter: byte[];
v := @parameter: int;
v := @parameter: int;
v = staticinvoke <com.google.common.io.ByteStreams: int read(java.io.InputStream,byte[],int,int)>(v, v, v, v);
if v == v goto label;
v = new java.io.EOFException;
specialinvoke v.<java.lang.StringBuilder: void <init>(int)>(81);
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (int,int)>(v, v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("reached end of stream after reading \u bytes; \u bytes expected");
specialinvoke v.<java.io.EOFException: void <init>(java.lang.String)>(v);
throw v;
label:
return;
}
public static void skipFully(java.io.InputStream, long) throws java.io.IOException
{
byte v;
java.lang.StringBuilder v;
long v, v;
java.lang.String v;
java.io.EOFException v;
java.io.InputStream v;
v := @parameter: java.io.InputStream;
v := @parameter: long;
v = staticinvoke <com.google.common.io.ByteStreams: long skipUpTo(java.io.InputStream,long)>(v, v);
v = v cmp v;
if v >= 0 goto label;
v = new java.io.EOFException;
specialinvoke v.<java.lang.StringBuilder: void <init>(int)>(100);
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (long,long)>(v, v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("reached end of stream after skipping \u bytes; \u bytes expected");
specialinvoke v.<java.io.EOFException: void <init>(java.lang.String)>(v);
throw v;
label:
return;
}
static long skipUpTo(java.io.InputStream, long) throws java.io.IOException
{
byte[] v;
long v, v, v, v, v;
byte v, v, v;
int v;
java.io.InputStream v;
v := @parameter: java.io.InputStream;
v := @parameter: long;
v = 0L;
v = null;
label:
v = v cmp v;
if v >= 0 goto label;
v = v - v;
v = staticinvoke <com.google.common.io.ByteStreams: long skipSafely(java.io.InputStream,long)>(v, v);
v = v cmp 0L;
if v != 0 goto label;
v = staticinvoke <java.lang.Math: long min(long,long)>(v, 8192L);
if v != null goto label;
v = newarray (byte)[v];
label:
v = virtualinvoke v.<java.io.InputStream: int read(byte[],int,int)>(v, 0, v);
v = v;
v = v cmp -1L;
if v == 0 goto label;
label:
v = v + v;
goto label;
label:
return v;
}
private static long skipSafely(java.io.InputStream, long) throws java.io.IOException
{
int v;
long v, v, v;
java.io.InputStream v;
v := @parameter: java.io.InputStream;
v := @parameter: long;
v = virtualinvoke v.<java.io.InputStream: int available()>();
if v != 0 goto label;
v = 0L;
goto label;
label:
v = staticinvoke <java.lang.Math: long min(long,long)>(v, v);
v = virtualinvoke v.<java.io.InputStream: long skip(long)>(v);
label:
return v;
}
public static java.lang.Object readBytes(java.io.InputStream, com.google.common.io.ByteProcessor) throws java.io.IOException
{
byte[] v;
com.google.common.io.ByteProcessor v;
int v, v;
java.lang.Object v;
boolean v;
java.io.InputStream v;
v := @parameter: java.io.InputStream;
v := @parameter: com.google.common.io.ByteProcessor;
staticinvoke <com.google.common.base.Preconditions: java.lang.Object checkNotNull(java.lang.Object)>(v);
staticinvoke <com.google.common.base.Preconditions: java.lang.Object checkNotNull(java.lang.Object)>(v);
v = staticinvoke <com.google.common.io.ByteStreams: byte[] createBuffer()>();
label:
v = virtualinvoke v.<java.io.InputStream: int read(byte[])>(v);
v = (int) -1;
if v == v goto label;
v = interfaceinvoke v.<com.google.common.io.ByteProcessor: boolean processBytes(byte[],int,int)>(v, 0, v);
if v != 0 goto label;
label:
v = interfaceinvoke v.<com.google.common.io.ByteProcessor: java.lang.Object getResult()>();
return v;
}
public static int read(java.io.InputStream, byte[], int, int) throws java.io.IOException
{
byte[] v;
java.lang.IndexOutOfBoundsException v;
java.lang.Object[] v;
java.lang.Integer v;
int v, v, v, v, v, v, v, v, v;
java.lang.String v;
java.io.InputStream v;
v := @parameter: java.io.InputStream;
v := @parameter: byte[];
v := @parameter: int;
v := @parameter: int;
staticinvoke <com.google.common.base.Preconditions: java.lang.Object checkNotNull(java.lang.Object)>(v);
staticinvoke <com.google.common.base.Preconditions: java.lang.Object checkNotNull(java.lang.Object)>(v);
if v >= 0 goto label;
v = new java.lang.IndexOutOfBoundsException;
v = newarray (java.lang.Object)[1];
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
v[0] = v;
v = staticinvoke <java.lang.String: java.lang.String format(java.lang.String,java.lang.Object[])>("len (%s) cannot be negative", v);
specialinvoke v.<java.lang.IndexOutOfBoundsException: void <init>(java.lang.String)>(v);
throw v;
label:
v = v + v;
v = lengthof v;
staticinvoke <com.google.common.base.Preconditions: void checkPositionIndexes(int,int,int)>(v, v, v);
v = 0;
label:
if v >= v goto label;
v = v + v;
v = v - v;
v = virtualinvoke v.<java.io.InputStream: int read(byte[],int,int)>(v, v, v);
v = (int) -1;
if v == v goto label;
v = v + v;
goto label;
label:
return v;
}
static void <clinit>()
{
com.google.common.io.ByteStreams$1 v;
v = new com.google.common.io.ByteStreams$1;
specialinvoke v.<com.google.common.io.ByteStreams$1: void <init>()>();
<com.google.common.io.ByteStreams: java.io.OutputStream NULL_OUTPUT_STREAM> = v;
return;
}
}