Class HTTPRequestReader.LineReader

java.lang.Object
de.linusdev.lutils.http.HTTPRequestReader.LineReader
Enclosing class:
HTTPRequestReader

public class HTTPRequestReader.LineReader extends Object
Reader that can read lines.

If the line end is reached, the flag eol will be true.
If the file end is reached, the flag eof will be true.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    boolean
    Indicates that no more can be read.
    boolean
    Indicates that the end of the line has been reached.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull String
    readUntil(char c)
    Reads until the first occurrence of the character c, the end of the line or the end of the file.
    @NotNull String
    Reads until the first occurrence of the character the end of the line or the end of the file.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • eof

      public boolean eof
      Indicates that no more can be read. Further read operations will return empty strings.
    • eol

      public boolean eol
      Indicates that the end of the line has been reached. Further read operations will read the next line.
  • Constructor Details

    • LineReader

      public LineReader()
  • Method Details

    • readUntil

      @NotNull public @NotNull String readUntil(char c) throws IOException
      Reads until the first occurrence of the character c, the end of the line or the end of the file. This method will set the eol and eof flags accordingly.
      Parameters:
      c - the character to which to read to
      Returns:
      the String read, not containing c or \r\n.
      Throws:
      IOException
    • readUntilLineFeed

      @NotNull public @NotNull String readUntilLineFeed() throws IOException
      Reads until the first occurrence of the character the end of the line or the end of the file. This method will set the eol and eof flags accordingly.
      Returns:
      the String read, not containing \r\n.
      Throws:
      IOException