hxb
2022-03-21 0188dee359636723190f0f67a6b674b7b08f7bef
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package com.hdl.sdk.socket.codec;
 
/**
 * Created by Tong on 2021/9/22.
 */
public abstract class ByteToMessageDecoder<T> implements IHandleFlow<T> {
 
    protected abstract T decoder(Object msg,String ipaddress)
            throws Exception;
 
    @Override
    public final T read(Object data,String ipaddress) throws Exception {
        return decoder(data,ipaddress);
    }
 
    @Override
    public final byte[] write(byte[] data) {
        return data;
    }
}