📄 zfencoder.java
字号:
package com.frontMachine.codec;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import org.apache.mina.common.ByteBuffer;
/**
* @转发服务编码器 无特殊编码 只是直接返回信息的字节数组
* @author LRT
* @version 1.0
*/
public class ZFEncoder extends AbstractEncoder
{
private static final Set TYPES;
static
{
Set types = new HashSet();
types.add( String.class );
TYPES = Collections.unmodifiableSet( types );
}
public ZFEncoder()
{
super();
}
protected void encodeBody( String message, ByteBuffer out )
{
out.put(ByteBuffer.wrap(message.getBytes()));
}
public Set getMessageTypes()
{
return TYPES;
}
public void dispose() throws Exception
{
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -