com.crashlytics.tools.android_2.1.0

long size)
  {
    this(size, true);
  }
  
  public SizeFileFilter(long size, boolean acceptLarger)
  {
    if (size < 0L) {
      throw new IllegalArgumentException("The size must be non-negative");
    }
    this.size = size;
    this.acceptLarger = acceptLarger;
  }
  
  public boolean accept(File file)
  {
    boolean smaller = file.length() < size;
    return acceptLarger ? false : !smaller ? true : smaller;
  }
  
  public String toString()
  {
    String condition = acceptLarger ? ">=" : "<";
    return super.toString() + "(" + condition + size + ")";
  }
}

/* Location:
 * Qualified Name:     org.apache.commons.io.filefilter.SizeFileFilter
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.commons.io.filefilter;

import java.io.File;
import java.io.Serializable;
import java.util.List;
import org.apache.commons.io.IOCase;

public class SuffixFileFilter
  extends AbstractFileFilter
  implements Serializable
{
  private final String[] suffixes;
  private final IOCase caseSensitivity;
  
  public SuffixFileFilter(String suffix)
  {
    this(suffix, IOCase.SENSITIVE);
  }
  
  public SuffixFileFilter(String suffix, IOCase caseSensitivity)
  {
    if (suffix == null) {
      throw new IllegalArgumentException("The suffix must not be null");
    }
    suffixes = new String[] { suffix };
    this.caseSensitivity = (caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity);
  }
  
  public SuffixFileFilter(String[] suffixes)
  {
    this(suffixes, IOCase.SENSITIVE);
  }
  
  public SuffixFileFilter(String[] suffixes, IOCase caseSensitivity)
  {
    if (suffixes == null) {
      throw new IllegalArgumentException("The array of suffixes must not be null");
    }
    this.suffixes = new String[suffixes.length];
    System.arraycopy(suffixes, 0, this.suffixes, 0, suffixes.length);
    this.caseSensitivity = (caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity);
  }
  
  public SuffixFileFilter(List<String> suffixes)
  {
    this(suffixes, IOCase.SENSITIVE);
  }
  
  public SuffixFileFilter(List<String> suffixes, IOCase caseSensitivity)
  {
    if (suffixes == null) {
      throw new IllegalArgumentException("The list of suffixes must not be null");
    }
    this.suffixes = ((String[])suffixes.toArray(new String[suffixes.size()]));
    this.caseSensitivity = (caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity);
  }
  
  public boolean accept(File file)
  {
    String name = file.getName();
    for (String suffix : suffixes) {
      if (caseSensitivity.checkEndsWith(name, suffix)) {
        return true;
      }
    }
    return false;
  }
  
  public boolean accept(File file, String name)
  {
    for (String suffix : suffixes) {
      if (caseSensitivity.checkEndsWith(name, suffix)) {
        return true;
      }
    }
    return false;
  }
  
  public String toString()
  {
    StringBuilder buffer = new StringBuilder();
    buffer.append(super.toString());
    buffer.append("(");
    if (suffixes != null) {
      for (int i = 0; i < suffixes.length; i++)
      {
        if (i > 0) {
          buffer.append(",");
        }
        buffer.append(suffixes[i]);
      }
    }
    buffer.append(")");
    return buffer.toString();
  }
}

/* Location:
 * Qualified Name:     org.apache.commons.io.filefilter.SuffixFileFilter
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.commons.io.filefilter;

import java.io.File;
import java.io.Serializable;

public class TrueFileFilter
  implements IOFileFilter, Serializable
{
  public static final IOFileFilter TRUE = new TrueFileFilter();
  public static final IOFileFilter INSTANCE = TRUE;
  
  public boolean accept(File file)
  {
    return true;
  }
  
  public boolean accept(File dir, String name)
  {
    return true;
  }
}

/* Location:
 * Qualified Name:     org.apache.commons.io.filefilter.TrueFileFilter
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.commons.io.filefilter;

import java.io.File;
import java.io.Serializable;
import java.util.List;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.IOCase;

public class WildcardFileFilter
  extends AbstractFileFilter
  implements Serializable
{
  private final String[] wildcards;
  private final IOCase caseSensitivity;
  
  public WildcardFileFilter(String wildcard)
  {
    this(wildcard, null);
  }
  
  public WildcardFileFilter(String wildcard, IOCase caseSensitivity)
  {
    if (wildcard == null) {
      throw new IllegalArgumentException("The wildcard must not be null");
    }
    wildcards = new String[] { wildcard };
    this.caseSensitivity = (caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity);
  }
  
  public WildcardFileFilter(String[] wildcards)
  {
    this(wildcards, null);
  }
  
  public WildcardFileFilter(String[] wildcards, IOCase caseSensitivity)
  {
    if (wildcards == null) {
      throw new IllegalArgumentException("The wildcard array must not be null");
    }
    this.wildcards = new String[wildcards.length];
    System.arraycopy(wildcards, 0, this.wildcards, 0, wildcards.length);
    this.caseSensitivity = (caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity);
  }
  
  public WildcardFileFilter(List<String> wildcards)
  {
    this(wildcards, null);
  }
  
  public WildcardFileFilter(List<String> wildcards, IOCase caseSensitivity)
  {
    if (wildcards == null) {
      throw new IllegalArgumentException("The wildcard list must not be null");
    }
    this.wildcards = ((String[])wildcards.toArray(new String[wildcards.size()]));
    this.caseSensitivity = (caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity);
  }
  
  public boolean accept(File dir, String name)
  {
    for (String wildcard : wildcards) {
      if (FilenameUtils.wildcardMatch(name, wildcard, caseSensitivity)) {
        return true;
      }
    }
    return false;
  }
  
  public boolean accept(File file)
  {
    String name = file.getName();
    for (String wildcard : wildcards) {
      if (FilenameUtils.wildcardMatch(name, wildcard, caseSensitivity)) {
        return true;
      }
    }
    return false;
  }
  
  public String toString()
  {
    StringBuilder buffer = new StringBuilder();
    buffer.append(super.toString());
    buffer.append("(");
    if (wildcards != null) {
      for (int i = 0; i < wildcards.length; i++)
      {
        if (i > 0) {
          buffer.append(",");
        }
        buffer.append(wildcards[i]);
      }
    }
    buffer.append(")");
    return buffer.toString();
  }
}

/* Location:
 * Qualified Name:     org.apache.commons.io.filefilter.WildcardFileFilter
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.commons.io.filefilter;

import java.io.File;
import java.io.Serializable;
import java.util.List;
import org.apache.commons.io.FilenameUtils;

@Deprecated
public class WildcardFilter
  extends AbstractFileFilter
  implements Serializable
{
  private final String[] wildcards;
  
  public WildcardFilter(String wildcard)
  {
    if (wildcard == null) {
      throw new IllegalArgumentException("The wildcard must not be null");
    }
    wildcards = new String[] { wildcard };
  }
  
  public WildcardFilter(String[] wildcards)
  {
    if (wildcards == null) {
      throw new IllegalArgumentException("The wildcard array must not be null");
    }
    this.wildcards = new String[wildcards.length];
    System.arraycopy(wildcards, 0, this.wildcards, 0, wildcards.length);
  }
  
  public WildcardFilter(List<String> wildcards)
  {
    if (wildcards == null) {
      throw new IllegalArgumentException("The wildcard list must not be null");
    }
    this.wildcards = ((String[])wildcards.toArray(new String[wildcards.size()]));
  }
  
  public boolean accept(File dir, String name)
  {
    if ((dir != null) && (new File(dir, name).isDirectory())) {
      return false;
    }
    for (String wildcard : wildcards) {
      if (FilenameUtils.wildcardMatch(name, wildcard)) {
        return true;
      }
    }
    return false;
  }
  
  public boolean accept(File file)
  {
    if (file.isDirectory()) {
      return false;
    }
    for (String wildcard : wildcards) {
      if (FilenameUtils.wildcardMatch(file.getName(), wildcard)) {
        return true;
      }
    }
    return false;
  }
}

/* Location:
 * Qualified Name:     org.apache.commons.io.filefilter.WildcardFilter
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.commons.io.input;

import java.io.IOException;
import java.io.InputStream;

public class AutoCloseInputStream
  extends ProxyInputStream
{
  public AutoCloseInputStream(InputStream in)
  {
    super(in);
  }
  
  public void close()
    throws IOException
  {
    in.close();
    in = new ClosedInputStream();
  }
  
  protected void afterRead(int n)
    throws IOException
  {
    if (n == -1) {
      close();
    }
  }
  
  protected void finalize()
    throws Throwable
  {
    close();
    super.finalize();
  }
}

/* Location:
 * Qualified Name:     org.apache.commons.io.input.AutoCloseInputStream
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.commons.io.input;

import java.util.Comparator;
import org.apache.commons.io.ByteOrderMark;

final class BOMInputStream$1
  implements Comparator<ByteOrderMark>
{
  public int compare(ByteOrderMark bom1, ByteOrderMark bom2)
  {
    int len1 = bom1.length();
    int len2 = bom2.length();
    if (len1 > len2) {
      return -1;
    }
    if (len2 > len1) {
      return 1;
    }
    return 0;
  }
}

/* Location:
 * Qualified Name:     org.apache.commons.io.input.BOMInputStream.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.commons.io.input;

import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import org.apache.commons.io.ByteOrderMark;

public class BOMInputStream
  extends ProxyInputStream
{
  private final boolean include;
  private final List<ByteOrderMark> boms;
  private ByteOrderMark byteOrderMark;
  private int[] firstBytes;
  private int fbLength;
  private int fbIndex;
  private int markFbIndex;
  private boolean markedAtStart;
  
  public BOMInputStream(InputStream delegate)
  {
    this(delegate, false, new ByteOrderMark[] { ByteOrderMark.UTF_8 });
  }
  
  public BOMInputStream(InputStream delegate, boolean include)
  {
    this(delegate, include, new ByteOrderMark[] { ByteOrderMark.UTF_8 });
  }
  
  public BOMInputStream(InputStream delegate, ByteOrderMark... boms)
  {
    this(delegate, false, boms);
  }
  
  private static final Comparator<ByteOrderMark> ByteOrderMarkLengthComparator = new Comparator()
  {
    public int compare(ByteOrderMark bom1, ByteOrderMark bom2)
    {
      int len1 = bom1.length();
      int len2 = bom2.length();
      if (len1 > len2) {
        return -1;
      }
      if (len2 > len1) {
        return 1;
      }
      return 0;
    }
  };
  
  public BOMInputStream(InputStream delegate, boolean include, ByteOrderMark... boms)
  {
    super(delegate);
    if ((boms == null) || (boms.length == 0)) {
      throw new IllegalArgumentException("No BOMs specified");
    }
    this.include = include;
    
    Arrays.sort(boms, ByteOrderMarkLengthComparator);
    this.boms = Arrays.asList(boms);
  }
  
  public boolean hasBOM()
    throws IOException
  {
    return getBOM() != null;
  }
  
  public boolean hasBOM(ByteOrderMark bom)
    throws IOException
  {
    if (!boms.contains(bom)) {
      throw new IllegalArgumentException("Stream not configure to detect " + bom);
    }
    return (byteOrderMark != null) && (getBOM().equals(bom));
  }
  
  public ByteOrderMark getBOM()
    throws IOException
  {
    if (firstBytes == null)
    {
      fbLength = 0;
      
      int maxBomSize = ((ByteOrderMark)boms.get(0)).length();
      firstBytes = new int[maxBomSize];
      for (int i = 0; i < firstBytes.length; i++)
      {
        firstBytes[i] = in.read();
        fbLength += 1;
        if (firstBytes[i] < 0) {
          break;
        }
      }
      byteOrderMark = find();
      if ((byteOrderMark != null) && 
        (!include)) {
        if (byteOrderMark.length() < firstBytes.length) {
          fbIndex = byteOrderMark.length();
        } else {
          fbLength = 0;
        }
      }
    }
    return byteOrderMark;
  }
  
  public String getBOMCharsetName()
    throws IOException
  {
    getBOM();
    return byteOrderMark == null ? null : byteOrderMark.getCharsetName();
  }
  
  private int readFirstBytes()
    throws IOException
  {
    getBOM();
    return fbIndex < fbLength ? firstBytes[(fbIndex++)] : -1;
  }
  
  private ByteOrderMark find()
  {
    for (ByteOrderMark bom : boms) {
      if (matches(bom)) {
        return bom;
      }
    }
    return null;
  }
  
  private boolean matches(ByteOrderMark bom)
  {
    for (int i = 0; i < bom.length(); i++) {
      if (bom.get(i) != firstBytes[i]) {
        return false;
      }
    }
    return true;
  }
  
  public int read()
    throws IOException
  {
    int b = readFirstBytes();
    return b >= 0 ? b : in.read();
  }
  
  public int read(byte[] buf, int off, int len)
    throws IOException
  {
    int firstCount = 0;
    int b = 0;
    while ((len > 0) && (b >= 0))
    {
      b = readFirstBytes();
      if (b >= 0)
      {
        buf[(off++)] = ((byte)(b & 0xFF));
        len--;
        firstCount++;
      }
    }
    int secondCount = in.read(buf, off, len);
    return secondCount < 0 ? -1 : firstCount > 0 ? firstCount : firstCount + secondCount;
  }
  
  public int read(byte[] buf)
    throws IOException
  {
    return read(buf, 0, buf.length);
  }
  
  public synchronized void mark(int readlimit)
  {
    markFbIndex = fbIndex;
    markedAtStart = (firstBytes == null);
    in.mark(readlimit);
  }
  
  public synchronized void reset()
    throws IOException
  {
    fbIndex = markFbIndex;
    if (markedAtStart) {
      firstBytes = null;
    }
    in.reset();
  }
  
  public long skip(long n)
    throws IOException
  {
    while ((n > 0L) && (readFirstBytes() >= 0)) {
      n -= 1L;
    }
    return in.skip(n);
  }
}

/* Location:
 * Qualified Name:     org.apache.commons.io.input.BOMInputStream
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.commons.io.input;

import java.io.IOException;
import java.io.InputStream;

public class BoundedInputStream
  extends InputStream
{
  private final InputStream in;
  private final long max;
  private long pos = 0L;
  private long mark = -1L;
  private boolean propagateClose = true;
  
  public BoundedInputStream(InputStream in, long size)
  {
    max = size;
    this.in = in;
  }
  
  public BoundedInputStream(InputStream in)
  {
    this(in, -1L);
  }
  
  public int read()
    throws IOException
  {
    if ((max >= 0L) && (pos >= max)) {
      return -1;
    }
    int result = in.read();
    pos += 1L;
    return result;
  }
  
  public int read(byte[] b)
    throws IOException
  {
    return read(b, 0, b.length);
  }
  
  public int read(byte[] b, int off, int len)
    throws IOException
  {
    if ((max >= 0L) && (pos >= max)) {
      return -1;
    }
    long maxRead = max >= 0L ? Math.min(len, max - pos) : len;
    int bytesRead = in.read(b, off, (int)maxRead);
    if (bytesRead == -1) {
      return -1;
    }
    pos += bytesRead;
    return bytesRead;
  }
  
  public long skip(long n)
    throws IOException
  {
    long toSkip = max >= 0L ? Math.min(n, max - pos) : n;
    long skippedBytes = in.skip(toSkip);
    pos += skippedBytes;
    return skippedBytes;
  }
  
  public int available()
    throws IOException
  {
    if ((max >= 0L) && (pos >= max)) {
      return 0;
    }
    return in.available();
  }
  
  public String toString()
  {
    return in.toString();
  }
  
  public void close()
    throws IOException
  {
    if (propagateClose) {
      in.close();
    }
  }
  
  public synchronized void reset()
    throws IOException
  {
    in.reset();
    pos = mark;
  }
  
  public synchronized void mark(int readlimit)
  {
    in.mark(readlimit);
    mark = pos;
  }
  
  public boolean markSupported()
  {
    return in.markSupported();
  }
  
  public boolean isPropagateClose()
  {
    return propagateClose;
  }
  
  public void setPropagateClose(boolean propagateClose)
  {
    this.propagateClose = propagateClose;
  }
}

/* Location:
 * Qualified Name:     org.apache.commons.io.input.BoundedInputStream
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.commons.io.input;

import java.io.IOException;
import java.io.InputStream;

public class BrokenInputStream
  extends InputStream
{
  private final IOException exception;
  
  public BrokenInputStream(IOException exception)
  {
    this.exception = exception;
  }
  
  public BrokenInputStream()
  {
    this(new IOException("Broken input stream"));
  }
  
  public int read()
    throws IOException
  {
    throw exception;
  }
  
  public int available()
    throws IOException
  {
    throw exception;
  }
  
  public long skip(long n)
    throws IOException
  {
    throw exception;
  }
  
  public void reset()
    throws IOException
  {
    throw exception;
  }
  
  public void close()
    throws IOException
  {
    throw exception;
  }
}

/* Location:
 * Qualified Name:     org.apache.commons.io.input.BrokenInputStream
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.commons.io.input;

import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.CharacterCodingException;
import java.nio.charset.Charset;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.CoderResult;
import java.nio.charset.CodingErrorAction;

public class CharSequenceInputStream
  extends InputStream
{
  private final CharsetEncoder encoder;
  private final CharBuffer cbuf;
  private final ByteBuffer bbuf;
  private int mark;
  
  public CharSequenceInputStream(CharSequence s, Charset charset, int bufferSize)
  {
    encoder = charset.newEncoder().onMalformedInput(CodingErrorAction.REPLACE).onUnmappableCharacter(CodingErrorAction.REPLACE);
    
    bbuf = ByteBuffer.allocate(bufferSize);
    bbuf.flip();
    cbuf = CharBuffer.wrap(s);
    mark = -1;
  }
  
  public CharSequenceInputStream(CharSequence s, String charset, int bufferSize)
  {
    this(s, Charset.forName(charset), bufferSize);
  }
  
  public CharSequenceInputStream(CharSequence s, Charset charset)
  {
    this(s, charset, 2048);
  }
  
  public CharSequenceInputStream(CharSequence s, String charset)
  {
    this(s, charset, 2048);
  }
  
  private void fillBuffer()
    throws CharacterCodingException
  {
    bbuf.compact();
    CoderResult result = encoder.encode(cbuf, bbuf, true);
    if (result.isError()) {
      result.throwException();
    }
    bbuf.flip();
  }
  
  public int read(byte[] b, int off, int len)
    throws IOException
  {
    if (b == null) {
      throw new NullPointerException("Byte array is null");
    }
    if ((len < 0) || (off + len > b.length)) {
      throw new IndexOutOfBoundsException("Array Size=" + b.length + ", offset=" + off + ", length=" + len);
    }
    if (len == 0) {
      return 0;
    }
    if ((!bbuf.hasRemaining()) && (!cbuf.hasRemaining())) {
      return -1;
    }
    int bytesRead = 0;
    while (len > 0) {
      if (bbuf.hasRemaining())
      {
        int chunk = Math.min(bbuf.remaining(), len);
        bbuf.get(b, off, chunk);
        off += chunk;
        len -= chunk;
        bytesRead += chunk;
      }
      else
      {
        fillBuffer();
        if ((!bbuf.hasRemaining()) && (!cbuf.hasRemaining())) {
          break;
        }
      }
    }
    return (bytesRead == 0) && (!cbuf.hasRemaining()) ? -1 : bytesRead;
  }
  
  public int read()
    throws IOException
  {
    do
    {
      if (bbuf.hasRemaining()) {
        return bbuf.get() & 0xFF;
      }
      fillBuffer();
    } while ((bbuf.hasRemaining()) || (cbuf.hasRemaining()));
    return -1;
  }
  
  public int read(byte[] b)
    throws IOException
  {
    return read(b, 0, b.length);
  }
  
  public long skip(long n)
    throws IOException
  {
    int skipped = 0;
    while ((n > 0L) && (cbuf.hasRemaining()))
    {
      cbuf.get();
      n -= 1L;
      skipped++;
    }
    return skipped;
  }
  
  public int available()
    throws IOException
  {
    return cbuf.remaining();
  }
  
  public void close()
    throws IOException
  {}
  
  public synchronized void mark(int readlimit)
  {
    mark = cbuf.position();
  }
  
  public synchronized void reset()
    throws IOException
  {
    if (mark != -1)
    {
      cbuf.position(mark);
      mark = -1;
    }
  }
  
  public boolean markSupported()
  {
    return true;
  }
}

/* Location:
 * Qualified Name:     org.apache.commons.io.input.CharSequenceInputStream
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.commons.io.input;

import java.io.Reader;
import java.io.Serializable;

public class CharSequenceReader
  extends Reader
  implements Serializable
{
  private final CharSequence charSequence;
  private int idx;
  private int mark;
  
  public CharSequenceReader(CharSequence charSequence)
  {
    this.charSequence = (charSequence != null ? charSequence : "");
  }
  
  public void close()
  {
    idx = 0;
    mark = 0;
  }
  
  public void mark(int readAheadLimit)
  {
    mark = idx;
  }
  
  public boolean markSupported()
  {
    return true;
  }
  
  public int read()
  {
    if (idx >= charSequence.length()) {
      return -1;
    }
    return charSequence.charAt(idx++);
  }
  
  public int read(char[] array, int offset, int length)
  {
    if (idx >= charSequence.length()) {
      return -1;
    }
    if (array == null) {
      throw new NullPointerException("Character array is missing");
    }
    if ((length < 0) || (offset < 0) || (offset + length > array.length)) {
      throw new IndexOutOfBoundsException("Array Size=" + array.length + ", offset=" + offset + ", length=" + length);
    }
    int count = 0;
    for (int i = 0; i < length; i++)
    {
      int c = read();
      if (c == -1) {
        return count;
      }
      array[(offset + i)] = ((char)c);
      count++;
    }
    return count;
  }
  
  public void reset()
  {
    idx = mark;
  }
  
  public long skip(long n)
  {
    if (n < 0L) {
      throw new IllegalArgumentException("Number of characters to skip is less than zero: " + n);
    }
    if (idx >= charSequence.length()) {
      return -1L;
    }
    int dest = (int)Math.min(charSequence.length(), idx + n);
    int count = dest - idx;
    idx = dest;
    return count;
  }
  
  public String toString()
  {
    return charSequence.toString();
  }
}

/* Location:
 * Qualified Name:     org.apache.commons.io.input.CharSequenceReader
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.commons.io.input;

import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectStreamClass;
import java.io.StreamCorruptedException;
import java.lang.reflect.Proxy;

public class ClassLoaderObjectInputStream
  extends ObjectInputStream
{
  private final ClassLoader classLoader;
  
  public ClassLoaderObjectInputStream(ClassLoader classLoader, InputStream inputStream)
    throws IOException, StreamCorruptedException
  {
    super(inputStream);
    this.classLoader = classLoader;
  }
  
  protected Class<?> resolveClass(ObjectStreamClass objectStreamClass)
    throws IOException, ClassNotFoundException
  {
    Class<?> clazz = Class.forName(objectStreamClass.getName(), false, classLoader);
    if (clazz != null) {
      return clazz;
    }
    return super.resolveClass(objectStreamClass);
  }
  
  protected Class<?> resolveProxyClass(String[] interfaces)
    throws IOException, ClassNotFoundException
  {
    Class<?>[] interfaceClasses = new Class[interfaces.length];
    for (int i = 0; i < interfaces.length; i++) {
      interfaceClasses[i] = Class.forName(interfaces[i], false, classLoader);
    }
    try
    {
      return Proxy.getProxyClass(classLoader, interfaceClasses);
    }
    catch (IllegalArgumentException e) {}
    return super.resolveProxyClass(interfaces);
  }
}

/* Location:
 * Qualified Name:     org.apache.commons.io.input.ClassLoaderObjectInputStream
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.commons.io.input;

import java.io.InputStream;

public class CloseShieldInputStream
  extends ProxyInputStream
{
  public CloseShieldInputStream(InputStream in)
  {
    super(in);
  }
  
  public void close()
  {
    in = new ClosedInputStream();
  }
}

/* Location:
 * Qualified Name:     org.apache.commons.io.input.CloseShieldInputStream
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.commons.io.input;

import java.io.InputStream;

public class ClosedInputStream
  extends InputStream
{
  public static final ClosedInputStream CLOSED_INPUT_STREAM = new ClosedInputStream();
  
  public int read()
  {
    return -1;
  }
}

/* Location:
 * Qualified Name:     org.apache.commons.io.input.ClosedInputStream
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.commons.io.input;

import java.io.IOException;
import java.io.InputStream;

public class CountingInputStream
  extends ProxyInputStream
{
  private long count;
  
  public CountingInputStream(InputStream in)
  {
    super(in);
  }
  
  public synchronized long skip(long length)
    throws IOException
  {
    long skip = super.skip(length);
    count += skip;
    return skip;
  }
  
  protected synchronized void afterRead(int n)
  {
    if (n != -1) {
      count += n;
    }
  }
  
  public int getCount()
  {
    long result = getByteCount();
    if (result > 2147483647L) {
      throw new ArithmeticException("The byte count " + result + " is too large to be converted to an int");
    }
    return (int)result;
  }
  
  public int resetCount()
  {
    long result = resetByteCount();
    if (result > 2147483647L) {
      throw new ArithmeticException("The byte count " + result + " is too large to be converted to an int");
    }
    return (int)result;
  }
  
  public synchronized long getByteCount()
  {
    return count;
  }
  
  public synchronized long resetByteCount()
  {
    long tmp = count;
    count = 0L;
    return tmp;
  }
}

/* Location:
 * Qualified Name:     org.apache.commons.io.input.CountingInputStream
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.commons.io.input;

import java.io.IOException;
import java.io.InputStream;

public class DemuxInputStream
  extends InputStream
{
  private final InheritableThreadLocal<InputStream> m_streams = new InheritableThreadLocal();
  
  public InputStream bindStream(InputStream input)
  {
    InputStream oldValue = (InputStream)m_streams.get();
    m_streams.set(input);
    return oldValue;
  }
  
  public void close()
    throws IOException
  {
    InputStream input = (InputStream)m_streams.get();
    if (null != input) {
      input.close();
    }
  }
  
  public int read()
    throws IOException
  {
    InputStream input = (InputStream)m_streams.get();
    if (null != input) {
      return input.read();
    }
    return -1;
  }
}

/* Location:
 * Qualified Name:     org.apache.commons.io.input.DemuxInputStream
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.commons.io.input;

import java.io.EOFException;
import java.io.IOException;
import java.io.InputStream;

public class NullInputStream
  extends InputStream
{
  private final long size;
  private long position;
  private long mark = -1L;
  private long readlimit;
  private boolean eof;
  private final boolean throwEofException;
  private final boolean markSupported;
  
  public NullInputStream(long size)
  {
    this(size, true, false);
  }
  
  public NullInputStream(long size, boolean markSupported, boolean throwEofException)
  {
    this.size = size;
    this.markSupported = markSupported;
    this.throwEofException = throwEofException;
  }
  
  public long getPosition()
  {
    return position;
  }
  
  public long getSize()
  {
    return size;
  }
  
  public int available()
  {
    long avail = size - position;
    if (avail <= 0L) {
      return 0;
    }
    if (avail > 2147483647L) {
      return Integer.MAX_VALUE;
    }
    return (int)avail;
  }
  
  public void close()
    throws IOException
  {
    eof = false;
    position = 0L;
    mark = -1L;
  }
  
  public synchronized void mark(int readlimit)
  {
    if (!markSupported) {
      throw new UnsupportedOperationException("Mark not supported");
    }
    mark = position;
    this.readlimit = readlimit;
  }
  
  public boolean markSupported()
  {
    return markSupported;
  }
  
  public int read()
    throws IOException
  {
    if (eof) {
      throw new IOException("Read after end of file");
    }
    if (position == size) {
      return doEndOfFile();
    }
    position += 1L;
    return processByte();
  }
  
  public int read(byte[] bytes)
    throws IOException
  {
    return read(bytes, 0, bytes.length);
  }
  
  public int read(byte[] bytes, int offset, int length)
    throws IOException
  {
    if (eof) {
      throw new IOException("Read after end of file");
    }
    if (position == size) {
      return doEndOfFile();
    }
    position += length;
    int returnLength = length;
    if (position > size)
    {
      returnLength = length - (int)(position - size);
      position = size;
    }
    processBytes(bytes, offset, returnLength);
    return returnLength;
  }
  
  public synchronized void reset()
    throws IOException
  {
    if (!markSupported) {
      throw new UnsupportedOperationException("Mark not supported");
    }
    if (mark < 0L) {
      throw new IOException("No position has been marked");
    }
    if (position > mark + readlimit) {
      throw new IOException("Marked position [" + mark + "] is no longer valid - passed the read limit [" + readlimit + "]");
    }
    position = mark;
    eof = false;
  }
  
  public long skip(long numberOfBytes)
    throws IOException
  {
    if (eof) {
      throw new IOException("Skip after end of file");
    }
    if (position == size) {
      return doEndOfFile();
    }
    position += numberOfBytes;
    long returnLength = numberOfBytes;
    if (position > size)
    {
      returnLength = numberOfBytes - (position - size);
      position = size;
    }
    return returnLength;
  }
  
  protected int processByte()
  {
    return 0;
  }
  
  protected void processBytes(byte[] bytes, int offset, int length) {}
  
  private int doEndOfFile()
    throws EOFException
  {
    eof = true;
    if (throwEofException) {
      throw new EOFException();
    }
    return -1;
  }
}

/* Location:
 * Qualified Name:     org.apache.commons.io.input.NullInputStream
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.commons.io.input;

import java.io.EOFException;
import java.io.IOException;
import java.io.Reader;

public class NullReader
  extends Reader
{
  private final long size;
  private long position;
  private long mark = -1L;
  private long readlimit;
  private boolean eof;
  private final boolean throwEofException;
  private final boolean markSupported;
  
  public NullReader(long size)
  {
    this(size, true, false);
  }
  
  public NullReader(long size, boolean markSupported, boolean throwEofException)
  {
    this.size = size;
    this.markSupported = markSupported;
    this.throwEofException = throwEofException;
  }
  
  public long getPosition()
  {
    return position;
  }
  
  public long getSize()
  {
    return size;
  }
  
  public void close()
    throws IOException
  {
    eof = false;
    position = 0L;
    mark = -1L;
  }
  
  public synchronized void mark(int readlimit)
  {
    if (!markSupported) {
      throw new UnsupportedOperationException("Mark not supported");
    }
    mark = position;
    this.readlimit = readlimit;
  }
  
  public boolean markSupported()
  {
    return markSupported;
  }
  
  public int read()
    throws IOException
  {
    if (eof) {
      throw new IOException("Read after end of file");
    }
    if (position == size) {
      return doEndOfFile();
    }
    position += 1L;
    return processChar();
  }
  
  public int read(char[] chars)
    throws IOException
  {
    return read(chars, 0, chars.length);
  }
  
  public int read(char[] chars, int offset, int length)
    throws IOException
  {
    if (eof) {
      throw new IOException("Read after end of file");
    }
    if (position == size) {
      return doEndOfFile();
    }
    position += length;
    int returnLength = length;
    if (position > size)
    {
      returnLength = length - (int)(position - size);
      position = size;
    }
    processChars(chars, offset, returnLength);
    return returnLength;
  }
  
  public synchronized void reset()
    throws IOException
  {
    if (!markSupported) {
      throw new UnsupportedOperationException("Mark not supported");
    }
    if (mark < 0L) {
      throw new IOException("No position has been marked");
    }
    if (position > mark + readlimit) {
      throw new IOException("Marked position [" + mark + "] is no longer valid - passed the read limit [" + readlimit + "]");
    }
    position = mark;
    eof = false;
  }
  
  public long skip(long numberOfChars)
    throws IOException
  {
    if (eof) {
      throw new IOException("Skip after end of file");
    }
    if (position == size) {
      return doEndOfFile();
    }
    position += numberOfChars;
    long returnLength = numberOfChars;
    if (position > size)
    {
      returnLength = numberOfChars - (position - size);
      position = size;
    }
    return returnLength;
  }
  
  protected int processChar()
  {
    return 0;
  }
  
  protected void processChars(char[] chars, int offset, int length) {}
  
  private int doEndOfFile()
    throws EOFException
  {
    eof = true;
    if (throwEofException) {
      throw new EOFException();
    }
    return -1;
  }
}

/* Location:
 * Qualified Name:     org.apache.commons.io.input.NullReader
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.commons.io.input;

import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;

public abstract class ProxyInputStream
  extends FilterInputStream
{
  public ProxyInputStream(InputStream proxy)
  {
    super(proxy);
  }
  
  public int read()
    throws IOException
  {
    try
    {
      beforeRead(1);
      int b = in.read();
      afterRead(b != -1 ? 1 : -1);
      return b;
    }
    catch (IOException e)
    {
      handleIOException(e);
    }
    return -1;
  }
  
  public int read(byte[] bts)
    throws IOException
  {
    try
    {
      beforeRead(bts != null ? bts.length : 0);
      int n = in.read(bts);
      afterRead(n);
      return n;
    }
    catch (IOException e)
    {
      handleIOException(e);
    }
    return -1;
  }
  
  public int read(byte[] bts, int off, int len)
    throws IOException
  {
    try
    {
      beforeRead(len);
      int n = in.read(bts, off, len);
      afterRead(n);
      return n;
    }
    catch (IOException e)
    {
      handleIOException(e);
    }
    return -1;
  }
  
  public long skip(long ln)
    throws IOException
  {
    try
    {
      return in.skip(ln);
    }
    catch (IOException e)
    {
      handleIOException(e);
    }
    return 0L;
  }
  
  public int available()
    throws IOException
  {
    try
    {
      return super.available();
    }
    catch (IOException e)
    {
      handleIOException(e);
    }
    return 0;
  }
  
  public void close()
    throws IOException
  {
    try
    {
      in.close();
    }
    catch (IOException e)
    {
      handleIOException(e);
    }
  }
  
  public synchronized void mark(int readlimit)
  {
    in.mark(readlimit);
  }
  
  public synchronized void reset()
    throws IOException
  {
    try
    {
      in.reset();
    }
    catch (IOException e)
    {
      handleIOException(e);
    }
  }
  
  public boolean markSupported()
  {
    return in.markSupported();
  }
  
  protected void beforeRead(int n)
    throws IOException
  {}
  
  protected void afterRead(int n)
    throws IOException
  {}
  
  protected void handleIOException(IOException e)
    throws IOException
  {
    throw e;
  }
}

/* Location:
 * Qualified Name:     org.apache.commons.io.input.ProxyInputStream
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.commons.io.input;

import java.io.FilterReader;
import java.io.IOException;
import java.io.Reader;
import java.nio.CharBuffer;

public abstract class ProxyReader
  extends FilterReader
{
  public ProxyReader(Reader proxy)
  {
    super(proxy);
  }
  
  public int read()
    throws IOException
  {
    try
    {
      beforeRead(1);
      int c = in.read();
      afterRead(c != -1 ? 1 : -1);
      return c;
    }
    catch (IOException e)
    {
      handleIOException(e);
    }
    return -1;
  }
  
  public int read(char[] chr)
    throws IOException
  {
    try
    {
      beforeRead(chr != null ? chr.length : 0);
      int n = in.read(chr);
      afterRead(n);
      return n;
    }
    catch (IOException e)
    {
      handleIOException(e);
    }
    return -1;
  }
  
  public int read(char[] chr, int st, int len)
    throws IOException
  {
    try
    {
      beforeRead(len);
      int n = in.read(chr, st, len);
      afterRead(n);
      return n;
    }
    catch (IOException e)
    {
      handleIOException(e);
    }
    return -1;
  }
  
  public int read(CharBuffer target)
    throws IOException
  {
    try
    {
      beforeRead(target != null ? target.length() : 0);
      int n = in.read(target);
      afterRead(n);
      return n;
    }
    catch (IOException e)
    {
      handleIOException(e);
    }
    return -1;
  }
  
  public long skip(long ln)
    throws IOException
  {
    try
    {
      return in.skip(ln);
    }
    catch (IOException e)
    {
      handleIOException(e);
    }
    return 0L;
  }
  
  public boolean ready()
    throws IOException
  {
    try
    {
      return in.ready();
    }
    catch (IOException e)
    {
      handleIOException(e);
    }
    return false;
  }
  
  public void close()
    throws IOException
  {
    try
    {
      in.close();
    }
    catch (IOException e)
    {
      handleIOException(e);
    }
  }
  
  public synchronized void mark(int idx)
    throws IOException
  {
    try
    {
      in.mark(idx);
    }
    catch (IOException e)
    {
      handleIOException(e);
    }
  }
  
  public synchronized void reset()
    throws IOException
  {
    try
    {
      in.reset();
    }
    catch (IOException e)
    {
      handleIOException(e);
    }
  }
  
  public boolean markSupported()
  {
    return in.markSupported();
  }
  
  protected void beforeRead(int n)
    throws IOException
  {}
  
  protected void afterRead(int n)
    throws IOException
  {}
  
  protected void handleIOException(IOException e)
    throws IOException
  {
    throw e;
  }
}

/* Location:
 * Qualified Name:     org.apache.commons.io.input.ProxyReader
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.commons.io.input;

import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.Charset;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.CoderResult;
import java.nio.charset.CodingErrorAction;

public class ReaderInputStream
  extends InputStream
{
  private static final int DEFAULT_BUFFER_SIZE = 1024;
  private final Reader reader;
  private final CharsetEncoder encoder;
  private final CharBuffer encoderIn;
  private final ByteBuffer encoderOut
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2019. Infinite Loop Ltd