Class QueueReader

java.lang.Object
java.io.Reader
org.aoju.bus.core.io.streams.QueueReader
All Implemented Interfaces:
Closeable, AutoCloseable, Readable

public class QueueReader extends Reader
队列InputStream
Since:
Java 17+
Author:
Kimi Liu
  • Constructor Details

    • QueueReader

      public QueueReader(Reader is)
  • Method Details

    • readItem

      public String readItem(char... ends) throws IOException
      读取一项数据
      Parameters:
      ends - 结束符, 默认' ', '\r', '\n'
      Returns:
      数据
      Throws:
      IOException - 异常
    • readLine

      public String readLine() throws IOException
      读取一行
      Returns:
      一行数据
      Throws:
      IOException - 异常
    • poll

      public int poll() throws IOException
      读取头部字节, 并删除
      Returns:
      头部字符
      Throws:
      IOException - 异常
    • peek

      public int peek(int index) throws IOException
      访问头部开始第几个字节, 不删除
      Parameters:
      index - 索引
      Returns:
      头部的第N个字符
      Throws:
      IOException - 异常
    • peekNext

      public int peekNext() throws IOException
      访问上次peekNext访问的下个位置的字节, 未访问过则访问索引0, poll, peek后归零, 不删除
      Returns:
      下一个位置的字符
      Throws:
      IOException - 异常
    • peek

      public int peek() throws IOException
      访问头部字节, 不删除
      Returns:
      头部字符
      Throws:
      IOException - 异常
    • skip

      public long skip(long n) throws IOException
      跳过和丢弃输入流中的数据
      Overrides:
      skip in class Reader
      Throws:
      IOException
    • isEnd

      public boolean isEnd()
      是否结束
      Returns:
      true, 如果流已经结束
    • read

      public int read(char[] cbuf, int off, int len) throws IOException
      Specified by:
      read in class Reader
      Throws:
      IOException
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in class Reader
      Throws:
      IOException
    • startWith

      public boolean startWith(String start) throws IOException
      是否以 start 开始
      Parameters:
      start - 开始位置
      Returns:
      true, 如果的确以指定字符串开始
      Throws:
      IOException - 异常
    • getCol

      public int getCol()
    • getRow

      public int getRow()