Class QueueInputStream

java.lang.Object
java.io.InputStream
org.aoju.bus.core.io.stream.QueueInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

public class QueueInputStream extends InputStream
Since:
Java 17+
Author:
Kimi Liu
  • Constructor Details

    • QueueInputStream

      public QueueInputStream(InputStream is)
  • Method Details

    • read

      public int read() throws IOException
      Specified by:
      read in class InputStream
      Throws:
      IOException
    • 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 InputStream
      Throws:
      IOException
    • isEnd

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

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

      public int getCol()
    • getRow

      public int getRow()