-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSmartCarProtocol.java
More file actions
58 lines (46 loc) · 1.24 KB
/
SmartCarProtocol.java
File metadata and controls
58 lines (46 loc) · 1.24 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package com.liudaxia.netty.stakepackage;
import java.util.Arrays;
/**
* Created by liudaxia on 2018/7/24.
*/
public class SmartCarProtocol {
/**
* 协议包含头,长度,data
*/
private int head_data = ConstantValue.HEAD_DATA;
private int contentLength ;
private byte[] content;
public SmartCarProtocol() {
}
public SmartCarProtocol(int contentLength, byte[] content) {
this.contentLength = contentLength;
this.content = content;
}
public SmartCarProtocol(int head_data, int contentLength, byte[] content) {
this.head_data = head_data;
this.contentLength = contentLength;
this.content = content;
}
public int getHead_data() {
return head_data;
}
public void setHead_data(int head_data) {
this.head_data = head_data;
}
public int getContentLength() {
return contentLength;
}
public void setContentLength(int contentLength) {
this.contentLength = contentLength;
}
public byte[] getContent() {
return content;
}
public void setContent(byte[] content) {
this.content = content;
}
@Override
public String toString() {
return new String(getContent());
}
}