1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
| package com.hdl.sdk.socket.codec;
|
|
| /**
| * Created by Tong on 2021/9/22.
| */
| public abstract class MessageToByteEncoder implements IHandleFlow {
|
|
| protected abstract byte[] encode(byte[] data)
| throws Exception;
|
| @Override
| public final Object read(Object data,String ipaddress) {
| return data;
| }
|
| @Override
| public byte[] write(byte[] data) throws Exception {
| return encode(data);
| }
|
|
| }
|
|