public class T212Generator extends Object implements Configured<T212Generator>, Closeable
| 构造器和说明 |
|---|
T212Generator(Writer writer) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close() |
void |
configured(Configurator<T212Generator> configurator)
被配置
|
void |
setGeneratorFeature(int generatorFeature)
设置生成特性
|
int |
writeCrc(char[] crc)
写入 DATA_CRC 校验
|
int |
writeData(char[] data)
读取 数据段
|
int |
writeDataAndLenAndCrc(char[] data)
写入 数据段长度+CRC校验
|
int |
writeDataLen(char[] len)
写入 数据段长度
|
int |
writeFooter()
写入 包尾
|
int |
writeHeader()
写入 包头
|
int |
writeHexInt32(int i)
写入 4字节Integer
|
public static char[] HEADER
public static char[] FOOTER
protected Writer writer
public T212Generator(Writer writer)
public void setGeneratorFeature(int generatorFeature)
generatorFeature - 生成特性public int writeHeader()
throws IOException
IOException - 读写异常PacketElement.HEADERpublic int writeDataLen(char[] len)
throws IOException,
T212FormatException
len - charsIOException - 读写异常T212FormatException - 212编码转换异常PacketElement.DATA_LENpublic int writeHexInt32(int i)
throws IOException
i - integerIOException - 读写异常public int writeData(char[] data)
throws IOException
data - data charsIOException - 读写异常PacketElement.DATApublic int writeCrc(char[] crc)
throws IOException,
T212FormatException
crc - crc charsT212FormatException - 212编码转换异常IOException - 读写异常PacketElement.DATA_CRCpublic int writeDataAndLenAndCrc(char[] data)
throws IOException,
T212FormatException
data - data charsT212FormatException - 212协议转换异常IOException - 读写异常PacketElement.DATA_LENpublic int writeFooter()
throws IOException
IOException - 读写异常PacketElement.FOOTERpublic void configured(Configurator<T212Generator> configurator)
Configuredconfigured 在接口中 Configured<T212Generator>configurator - 目标配置器public void close()
close 在接口中 Closeableclose 在接口中 AutoCloseableCopyright © 2021. All rights reserved.