public class GB26875Parser extends java.lang.Object implements Configured<GB26875Parser>, java.io.Closeable
| 限定符和类型 | 字段和说明 |
|---|---|
private int |
count
TEMP
|
protected java.io.DataInputStream |
dataOutputStream |
static char[] |
FOOTER |
static char[] |
HEADER |
protected byte[] |
msgBytes |
private int |
parserFeature |
| 构造器和说明 |
|---|
GB26875Parser(byte[] msgBytes) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close() |
void |
configured(Configurator<GB26875Parser> configurator)
配置器
|
boolean |
readCheck()
校验
|
short |
readControlOrder()
控制单元命令字符
|
java.util.Map<java.lang.String,java.lang.Object> |
readData(short len)
读取应用数据单元
|
short |
readDataLen()
读取 数据段长度
|
char[] |
readFooter()
读取 报文尾
|
char[] |
readHeader()
读取 包头
|
int |
readInt32(int radix)
读取 4字节Integer
|
short |
readMainVersion()
读取主版本号
|
short |
readSerialNum()
读取流水号
因为小端模式不能直接以short读出,只能以字节读出并小端模式转换
|
java.lang.String |
readSourceAddress()
读取源 mac地址
|
java.lang.String |
readTargetAddress()
读取目的 mac地址
|
java.time.LocalDateTime |
readTime()
读取报文传输时间
|
short |
readUserVersion()
读取用户版本号
|
void |
setParserFeature(int parserFeature)
设置解析特性
|
public static char[] HEADER
public static char[] FOOTER
protected java.io.DataInputStream dataOutputStream
protected byte[] msgBytes
private int parserFeature
private int count
public void setParserFeature(int parserFeature)
parserFeature - 解析特性public char[] readHeader()
throws GB26875Exception,
java.io.IOException
GB26875Exception - 协议转换异常java.io.IOException - 读写异常public short readSerialNum()
throws GB26875Exception,
java.io.IOException
因为小端模式不能直接以short读出,只能以字节读出并小端模式转换
GB26875Exceptionjava.io.IOExceptionpublic short readMainVersion()
throws java.io.IOException
java.io.IOExceptionpublic short readUserVersion()
throws java.io.IOException
java.io.IOExceptionpublic java.time.LocalDateTime readTime()
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String readSourceAddress()
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String readTargetAddress()
throws java.io.IOException
java.io.IOExceptionpublic short readDataLen()
throws GB26875Exception,
java.io.IOException
GB26875Exception - 212协议转换异常java.io.IOException - 读写异常public short readControlOrder()
throws java.io.IOException
java.io.IOExceptionpublic java.util.Map<java.lang.String,java.lang.Object> readData(short len)
throws GB26875Exception,
java.io.IOException
len - 应用数据单元长度java.io.IOExceptionGB26875Exceptionpublic boolean readCheck()
throws java.io.IOException,
GB26875Exception
java.io.IOExceptionGB26875Exceptionpublic char[] readFooter()
throws GB26875Exception,
java.io.IOException
GB26875Exception - 212协议转换异常java.io.IOException - 读写异常public void configured(Configurator<GB26875Parser> configurator)
Configuredconfigured 在接口中 Configured<GB26875Parser>public void close()
close 在接口中 java.io.Closeableclose 在接口中 java.lang.AutoCloseablepublic int readInt32(int radix)
throws java.io.IOException
radix - 进制java.io.IOException - 读写异常Copyright © 2023. All rights reserved.