左晓为主开发手持机充值管理机
zuoxiao
2023-11-14 5a843ba11b991722f8f2af386f0e546e2769f7c3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package com.dayu.recharge.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());
    }
}