Class ReadLine

java.lang.Object
net.reduls.igo.util.ReadLine

public class ReadLine extends Object
行読み込み用のクラス
  • Constructor Details

    • ReadLine

      public ReadLine(InputStream in) throws IOException
      入力ストリームを元に、このクラスのインスタンスを作成する
      Throws:
      IOException - 入出力エラーが発生した場合に送出される
    • ReadLine

      public ReadLine(String filepath, String encoding) throws IOException
      ファイルを元に、このクラスのインスタンスを作成する
      Parameters:
      filepath - 読み込むファイルのパス
      encoding - 読み込むファイルのエンコーディング
      Throws:
      IOException - 入出力エラーが発生した場合に送出される
  • Method Details

    • close

      public void close()
      読み込みを終了する
    • read

      public String read() throws IOException
      一行読み込む
      Returns:
      読み込んだ文字列. ストリームの終端に達してしる場合は、nullを返す
      Throws:
      IOException - 入出力エラーが発生した場合に送出される
    • readEof

      public String readEof() throws IOException, EOFException
      一行読み込む
      Returns:
      読み込んだ文字列
      Throws:
      EOFException - ストリームの終端に達している場合に送出される
      IOException - 入出力エラーが発生した場合に送出される
    • lineNumber

      public int lineNumber()
      これまでに読み込んだ行数を返す
      Returns:
      これまでに読み込んだ行数