自动化立体仓库 - WCS系统
#
vincent
2020-06-03 0972442009f05ffdf8ce44862260d880431c989e
src/main/java/com/zy/common/utils/Struct.java
@@ -16,6 +16,10 @@
import java.nio.charset.StandardCharsets;
import java.util.*;
/**
 * Tcp协议报文基类
 * @author vincent
 */
public class Struct implements java.io.Serializable {
   
   private transient Map<String,byte[]> decodeByteMapping = new HashMap<>();
@@ -28,11 +32,18 @@
   public Class getClassType(String name){
      return null;
   }
   /**
    * 判断大小端
    * @return true: 小端 / false: 大端
    */
   public boolean isReverse() {
      return this.getClass().getAnnotation(little.class)!=null;
   }
   /**
    * 获取字节数组
    */
   public byte[] toBytes() throws Exception {
      return encode(this);
   }
@@ -77,7 +88,6 @@
    * 
    * @param dos
    * @param entity
    * @throws Exception
    */
   public void write(DataOutputStream dos, Struct entity) throws Exception {
      if(entity==null)return;