LineReader.java 1.56 KB
package com.google.common.io;

import com.google.common.annotations.Beta;
import com.google.common.base.Preconditions;
import java.io.IOException;
import java.io.Reader;
import java.nio.CharBuffer;
import java.util.LinkedList;
import java.util.Queue;
import rd;

@Beta
public final class LineReader
{
  private final Readable a;
  private final Reader b;
  private final char[] c = new char['က'];
  private final CharBuffer d = CharBuffer.wrap(this.c);
  private final Queue<String> e = new LinkedList();
  private final rd f = new rd()
  {
    protected final void a(String paramAnonymousString)
    {
      LineReader.a(LineReader.this).add(paramAnonymousString);
    }
  };
  
  public LineReader(Readable paramReadable)
  {
    this.a = ((Readable)Preconditions.checkNotNull(paramReadable));
    if ((paramReadable instanceof Reader)) {}
    for (paramReadable = (Reader)paramReadable;; paramReadable = null)
    {
      this.b = paramReadable;
      return;
    }
  }
  
  public final String readLine()
    throws IOException
  {
    for (;;)
    {
      if (this.e.peek() == null)
      {
        this.d.clear();
        if (this.b == null) {
          break label70;
        }
      }
      label70:
      for (int i = this.b.read(this.c, 0, this.c.length); i == -1; i = this.a.read(this.d))
      {
        this.f.a();
        return (String)this.e.poll();
      }
      this.f.a(this.c, i);
    }
  }
}


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