| package com.dayu.henanlibrary.net; | 
|   | 
| import com.easysocket.EasySocket; | 
| import com.easysocket.utils.Utils; | 
|   | 
| import java.nio.charset.Charset; | 
|   | 
| /** | 
|  * Copyright (C), 2022, | 
|  * Author: zuo | 
|  * Date: 2022/3/10 16:33 | 
|  * Description: | 
|  */ | 
| public class SocketData { | 
|     private byte[] headerData; | 
|     private byte[] bodyData; | 
|   | 
|     public SocketData() { | 
|     } | 
|   | 
|     public byte[] getHeaderData() { | 
|         return this.headerData; | 
|     } | 
|   | 
|     public void setHeaderData(byte[] headerData) { | 
|         this.headerData = headerData; | 
|     } | 
|   | 
|     public byte[] getBodyBytes() { | 
|         return this.bodyData; | 
|     } | 
|   | 
|     public void setBodyData(byte[] bodyData) { | 
|         this.bodyData = bodyData; | 
|     } | 
|   | 
|     public String getBodyString() { | 
|         return new String(this.getBodyBytes(), Charset.forName(EasySocket.getInstance().getDefOptions().getCharsetName())); | 
|     } | 
|   | 
|     public byte[] getOriginDataBytes() { | 
|         return Utils.concatBytes(this.getHeaderData(), this.getBodyBytes()); | 
|     } | 
| } |