Class ByteArrayDataReader

java.lang.Object
cool.scx.io.data_reader.ByteArrayDataReader
All Implemented Interfaces:
DataReader

public class ByteArrayDataReader extends Object implements DataReader
ByteArrayDataReader
Version:
0.0.1
Author:
scx567888
  • Constructor Summary

    Constructors
    Constructor
    Description
    ByteArrayDataReader(byte[] bytes)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    indexOf(byte[] b, long maxLength)
    查找 指定字节数组 第一次出现的 index (指针不会移动)
    long
    indexOf(byte b, long maxLength)
    查找 指定字节 第一次出现的 index (指针不会移动)
    byte
    向 dataConsumer 写入指定长度字节 (指针不会移动) 当没有更多的数据时会抛出异常
    byte[]
    peek(int maxLength)
    读取指定长度字节 (指针不会移动) 当没有更多的数据时会抛出异常
    void
    peek(DataConsumer dataConsumer, long maxLength)
    向 outputStream 写入指定长度字节 (指针不会移动) 当没有更多的数据时会抛出异常
    byte
    读取单个字节 (指针会移动) 当没有更多的数据时会抛出异常
    byte[]
    read(int maxLength)
    读取字节 (指针会移动) 当没有更多的数据时会抛出异常
    void
    read(DataConsumer dataConsumer, long maxLength)
    向 dataConsumer 写入指定长度字节 (指针会移动) 当没有更多的数据时会抛出异常
    void
    skip(long length)
    向后移动指定字节

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface cool.scx.io.data_reader.DataReader

    indexOf, indexOf, peekUntil, peekUntil, peekUntil, peekUntil, readUntil, readUntil, readUntil, readUntil