Interface DataReader
- All Known Implementing Classes:
ByteArrayDataReader,LinkedDataReader,PowerfulLinkedDataReader
public interface DataReader
DataReader
- Version:
- 0.0.1
- Author:
- scx567888
-
Method Summary
Modifier and TypeMethodDescriptiondefault longindexOf(byte b) 查找 指定字节 第一次出现的 index (指针不会移动)default longindexOf(byte[] b) 查找 指定字节数组 第一次出现的 index (指针不会移动)longindexOf(byte[] b, long max) 查找 指定字节数组 第一次出现的 index (指针不会移动)longindexOf(byte b, long max) 查找 指定字节 第一次出现的 index (指针不会移动)bytepeek()向 dataConsumer 写入指定长度字节 (指针不会移动) 当没有更多的数据时会抛出异常byte[]peek(int maxLength) 读取指定长度字节 (指针不会移动) 当没有更多的数据时会抛出异常voidpeek(DataConsumer dataConsumer, long maxLength) 向 outputStream 写入指定长度字节 (指针不会移动) 当没有更多的数据时会抛出异常default byte[]peekUntil(byte b) 读取 直到 找到匹配的字节 (指针不会移动)default byte[]peekUntil(byte[] b) 读取 直到 找到匹配的字节 (指针不会移动)default byte[]peekUntil(byte[] b, int max) 读取 直到 找到匹配的字节 (指针不会移动)default byte[]peekUntil(byte b, int max) 读取 直到 找到匹配的字节 (指针不会移动)byteread()读取单个字节 (指针会移动) 当没有更多的数据时会抛出异常byte[]read(int maxLength) 读取字节 (指针会移动) 当没有更多的数据时会抛出异常voidread(DataConsumer dataConsumer, long maxLength) 向 dataConsumer 写入指定长度字节 (指针会移动) 当没有更多的数据时会抛出异常default byte[]readUntil(byte b) 读取 直到 找到匹配的字节 (指针会移动)default byte[]readUntil(byte[] b) 读取 直到 找到匹配的字节 (指针会移动)default byte[]readUntil(byte[] b, int max) 读取 直到 找到匹配的字节 (指针会移动)default byte[]readUntil(byte b, int max) 读取 直到 找到匹配的字节 (指针会移动)voidskip(long length) 向后移动指定字节
-
Method Details
-
read
读取单个字节 (指针会移动) 当没有更多的数据时会抛出异常- Returns:
- byte
- Throws:
NoMoreDataException- 没有更多数据时抛出
-
read
读取字节 (指针会移动) 当没有更多的数据时会抛出异常- Parameters:
maxLength- 最大长度- Returns:
- bytes
- Throws:
NoMoreDataException- 没有更多数据时抛出
-
read
向 dataConsumer 写入指定长度字节 (指针会移动) 当没有更多的数据时会抛出异常- Parameters:
maxLength- 最大长度- Throws:
NoMoreDataException- 没有更多数据时抛出
-
peek
向 dataConsumer 写入指定长度字节 (指针不会移动) 当没有更多的数据时会抛出异常- Returns:
- byte
- Throws:
NoMoreDataException- 没有更多数据时抛出
-
peek
读取指定长度字节 (指针不会移动) 当没有更多的数据时会抛出异常- Parameters:
maxLength- 最大长度- Returns:
- byte
- Throws:
NoMoreDataException- 没有更多数据时抛出
-
peek
向 outputStream 写入指定长度字节 (指针不会移动) 当没有更多的数据时会抛出异常- Parameters:
maxLength- 最大长度- Throws:
NoMoreDataException- 没有更多数据时抛出
-
indexOf
查找 指定字节 第一次出现的 index (指针不会移动)- Parameters:
b- 指定字节max- 最大长度- Returns:
- index 或者 -1 (未找到)
- Throws:
NoMatchFoundException- 没有匹配时抛出NoMoreDataException
-
indexOf
查找 指定字节数组 第一次出现的 index (指针不会移动)- Parameters:
b- 指定字节数组max- 最大长度- Returns:
- index 或者 -1 (未找到)
- Throws:
NoMatchFoundException- 没有匹配时抛出NoMoreDataException
-
skip
向后移动指定字节- Parameters:
length- 移动长度- Throws:
NoMoreDataException
-
indexOf
查找 指定字节 第一次出现的 index (指针不会移动)- Parameters:
b- 指定字节- Returns:
- index 或者 -1 (未找到)
- Throws:
NoMatchFoundException- 没有匹配时抛出NoMoreDataException
-
indexOf
查找 指定字节数组 第一次出现的 index (指针不会移动)- Parameters:
b- 指定字节数组- Returns:
- index 或者 -1 (未找到)
- Throws:
NoMatchFoundException- 没有匹配时抛出NoMoreDataException
-
readUntil
读取 直到 找到匹配的字节 (指针会移动)- Parameters:
b- 指定字节- Returns:
- bytes
- Throws:
NoMatchFoundException- 没有匹配时抛出NoMoreDataException
-
readUntil
读取 直到 找到匹配的字节 (指针会移动)- Parameters:
b- 指定字节- Returns:
- bytes
- Throws:
NoMatchFoundException- 没有匹配时抛出NoMoreDataException
-
peekUntil
读取 直到 找到匹配的字节 (指针不会移动)- Parameters:
b- 指定字节- Returns:
- bytes
- Throws:
NoMatchFoundException- 没有匹配时抛出NoMoreDataException
-
peekUntil
读取 直到 找到匹配的字节 (指针不会移动)- Parameters:
b- 指定字节- Returns:
- bytes
- Throws:
NoMatchFoundException- 没有匹配时抛出NoMoreDataException
-
readUntil
读取 直到 找到匹配的字节 (指针会移动)- Parameters:
b- 指定字节- Returns:
- bytes
- Throws:
NoMatchFoundException- 没有匹配时抛出NoMoreDataException
-
readUntil
读取 直到 找到匹配的字节 (指针会移动)- Parameters:
b- 指定字节- Returns:
- bytes
- Throws:
NoMatchFoundException- 没有匹配时抛出NoMoreDataException
-
peekUntil
读取 直到 找到匹配的字节 (指针不会移动)- Parameters:
b- 指定字节- Returns:
- bytes
- Throws:
NoMatchFoundException- 没有匹配时抛出NoMoreDataException
-
peekUntil
读取 直到 找到匹配的字节 (指针不会移动)- Parameters:
b- 指定字节- Returns:
- bytes
- Throws:
NoMatchFoundException- 没有匹配时抛出NoMoreDataException
-