re.java 2.11 KB
import com.google.common.base.Preconditions;
import com.google.common.io.ByteSource;
import java.io.IOException;
import java.io.InputStream;
import java.util.Iterator;
import javax.annotation.Nullable;

public final class re
  extends InputStream
{
  private Iterator<? extends ByteSource> a;
  private InputStream b;
  
  public re(Iterator<? extends ByteSource> paramIterator)
    throws IOException
  {
    this.a = ((Iterator)Preconditions.checkNotNull(paramIterator));
    a();
  }
  
  private void a()
    throws IOException
  {
    close();
    if (this.a.hasNext()) {
      this.b = ((ByteSource)this.a.next()).openStream();
    }
  }
  
  public final int available()
    throws IOException
  {
    if (this.b == null) {
      return 0;
    }
    return this.b.available();
  }
  
  public final void close()
    throws IOException
  {
    if (this.b != null) {}
    try
    {
      this.b.close();
      return;
    }
    finally
    {
      this.b = null;
    }
  }
  
  public final boolean markSupported()
  {
    return false;
  }
  
  public final int read()
    throws IOException
  {
    int i;
    for (;;)
    {
      if (this.b == null) {
        return -1;
      }
      i = this.b.read();
      if (i != -1) {
        break;
      }
      a();
    }
    return i;
  }
  
  public final int read(@Nullable byte[] paramArrayOfByte, int paramInt1, int paramInt2)
    throws IOException
  {
    int i;
    for (;;)
    {
      if (this.b == null) {
        return -1;
      }
      i = this.b.read(paramArrayOfByte, paramInt1, paramInt2);
      if (i != -1) {
        break;
      }
      a();
    }
    return i;
  }
  
  public final long skip(long paramLong)
    throws IOException
  {
    long l1;
    if ((this.b == null) || (paramLong <= 0L)) {
      l1 = 0L;
    }
    long l2;
    do
    {
      return l1;
      l2 = this.b.skip(paramLong);
      l1 = l2;
    } while (l2 != 0L);
    if (read() == -1) {
      return 0L;
    }
    return this.b.skip(paramLong - 1L) + 1L;
  }
}


/* Location:              /home/merong/decompile/hackery-dex2jar.jar!/re.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */