public class T212Parser extends Object implements Configured<T212Parser>, Closeable
| 构造器和说明 |
|---|
T212Parser(Reader reader) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close() |
void |
configured(Configurator<T212Parser> configurator)
被配置
|
static int |
crc16Checkout(char[] msg,
int length)
CRC校验
|
char[] |
readCrc()
读取 DATA_CRC 校验
|
char[] |
readData(int segmentLen)
读取 数据段
|
char[] |
readDataAndCrc(int dataLen)
读取 包尾
|
char[] |
readDataLen()
读取 数据段长度
|
char[] |
readFooter()
读取 数据段长度
|
char[] |
readHeader()
读取 包头
|
int |
readInt32(int radix)
读取 4字节Integer
|
void |
setParserFeature(int parserFeature)
设置解析特性
|
public static char[] HEADER
public static char[] FOOTER
protected Reader reader
public T212Parser(Reader reader)
public void setParserFeature(int parserFeature)
parserFeature - 解析特性public char[] readHeader()
throws T212FormatException,
IOException
T212FormatException - 212协议转换异常IOException - 读写异常#HEADERpublic char[] readDataLen()
throws T212FormatException,
IOException
T212FormatException - 212协议转换异常IOException - 读写异常PacketElement.DATA_LENpublic int readInt32(int radix)
throws IOException
radix - 进制IOException - 读写异常public char[] readData(int segmentLen)
throws T212FormatException,
IOException
T212FormatException - 212协议转换异常IOException - 读写异常PacketElement.DATApublic char[] readCrc()
throws T212FormatException,
IOException
T212FormatException - 212协议转换异常IOException - 读写异常PacketElement.DATA_CRCpublic char[] readFooter()
throws T212FormatException,
IOException
T212FormatException - 212协议转换异常IOException - 读写异常PacketElement.DATA_LENpublic char[] readDataAndCrc(int dataLen)
throws IOException,
T212FormatException
T212FormatException - 212协议转换异常IOException - 读写异常PacketElement.FOOTERpublic void configured(Configurator<T212Parser> configurator)
Configuredconfigured 在接口中 Configured<T212Parser>configurator - 目标配置器public void close()
close 在接口中 Closeableclose 在接口中 AutoCloseablepublic static int crc16Checkout(char[] msg,
int length)
msg - 消息length - 长度Copyright © 2021. All rights reserved.