ra.java 2.12 KB
import com.google.common.base.Preconditions;
import java.io.Closeable;
import java.io.Flushable;
import java.io.IOException;
import java.io.Writer;
import javax.annotation.Nullable;

public final class ra
  extends Writer
{
  private final Appendable a;
  private boolean b;
  
  public ra(Appendable paramAppendable)
  {
    this.a = ((Appendable)Preconditions.checkNotNull(paramAppendable));
  }
  
  private void a()
    throws IOException
  {
    if (this.b) {
      throw new IOException("Cannot write to a closed writer.");
    }
  }
  
  public final Writer append(char paramChar)
    throws IOException
  {
    a();
    this.a.append(paramChar);
    return this;
  }
  
  public final Writer append(@Nullable CharSequence paramCharSequence)
    throws IOException
  {
    a();
    this.a.append(paramCharSequence);
    return this;
  }
  
  public final Writer append(@Nullable CharSequence paramCharSequence, int paramInt1, int paramInt2)
    throws IOException
  {
    a();
    this.a.append(paramCharSequence, paramInt1, paramInt2);
    return this;
  }
  
  public final void close()
    throws IOException
  {
    this.b = true;
    if ((this.a instanceof Closeable)) {
      ((Closeable)this.a).close();
    }
  }
  
  public final void flush()
    throws IOException
  {
    a();
    if ((this.a instanceof Flushable)) {
      ((Flushable)this.a).flush();
    }
  }
  
  public final void write(int paramInt)
    throws IOException
  {
    a();
    this.a.append((char)paramInt);
  }
  
  public final void write(@Nullable String paramString)
    throws IOException
  {
    a();
    this.a.append(paramString);
  }
  
  public final void write(@Nullable String paramString, int paramInt1, int paramInt2)
    throws IOException
  {
    a();
    this.a.append(paramString, paramInt1, paramInt1 + paramInt2);
  }
  
  public final void write(char[] paramArrayOfChar, int paramInt1, int paramInt2)
    throws IOException
  {
    a();
    this.a.append(new String(paramArrayOfChar, paramInt1, paramInt2));
  }
}


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