当前位置: 首页>>代码示例>>Java>>正文


Java ProtocolDecoder类代码示例

本文整理汇总了Java中org.apache.mina.filter.codec.ProtocolDecoder的典型用法代码示例。如果您正苦于以下问题:Java ProtocolDecoder类的具体用法?Java ProtocolDecoder怎么用?Java ProtocolDecoder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ProtocolDecoder类属于org.apache.mina.filter.codec包,在下文中一共展示了ProtocolDecoder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getDecoder

import org.apache.mina.filter.codec.ProtocolDecoder; //导入依赖的package包/类
@Override
public ProtocolDecoder getDecoder(IoSession is) throws Exception {
    return new CumulativeProtocolDecoder() {

        protected boolean doDecode(IoSession session, IoBuffer in, ProtocolDecoderOutput out) throws Exception {
            if (in.remaining() > 0) {
                byte[] buf = new byte[in.remaining()];
                in.get(buf);
                out.write(new String(buf, "US-ASCII"));
                return true;
            } else {
                return false;
            }
        }
    };
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:17,代码来源:Mina2VMCustomCodecTest.java

示例2: getDecoder

import org.apache.mina.filter.codec.ProtocolDecoder; //导入依赖的package包/类
public ProtocolDecoder getDecoder() throws Exception {
    return new CumulativeProtocolDecoder() {
        protected boolean doDecode(IoSession session, ByteBuffer in, ProtocolDecoderOutput out) throws Exception {
            if (in.remaining() > 0) {
                byte[] buf = new byte[in.remaining()];
                in.get(buf);
                out.write(new String(buf, "US-ASCII"));
                return true;
            } else {
                return false;
            }
        }
    };
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:15,代码来源:MinaVMCustomCodecTest.java

示例3: getDecoder

import org.apache.mina.filter.codec.ProtocolDecoder; //导入依赖的package包/类
@Override
public ProtocolDecoder getDecoder(IoSession ioSession) throws Exception
{
    if(mDecoder == null)
    {
        mDecoder = new UltravoxDecoder();
    }

    return mDecoder;
}
 
开发者ID:DSheirer,项目名称:sdrtrunk,代码行数:11,代码来源:UltravoxProtocolFactory.java

示例4: getDecoder

import org.apache.mina.filter.codec.ProtocolDecoder; //导入依赖的package包/类
@Override
public ProtocolDecoder getDecoder(IoSession session) throws Exception {
	MinaDecoder minaDecoder = null;
	Object value = session.getAttribute(DECODER_ATTRIBUTE);
	if (value != null && value instanceof MinaDecoder)
		minaDecoder = (MinaDecoder) value;
	if (minaDecoder == null) {
		minaDecoder = new MinaDecoder(codecFactory.getDecoder());
		session.setAttribute(DECODER_ATTRIBUTE, minaDecoder);
	}
	return minaDecoder;
}
 
开发者ID:ugcs,项目名称:ugcs-java-sdk,代码行数:13,代码来源:MinaCodecFactory.java

示例5: getDecoder

import org.apache.mina.filter.codec.ProtocolDecoder; //导入依赖的package包/类
@Override
public ProtocolDecoder getDecoder(IoSession arg0) throws Exception {
	return decoder;
}
 
开发者ID:kingston-csj,项目名称:jforgame,代码行数:5,代码来源:MessageCodecFactory.java

示例6: getDecoder

import org.apache.mina.filter.codec.ProtocolDecoder; //导入依赖的package包/类
@Override
public ProtocolDecoder getDecoder(IoSession session) throws Exception {
    return msgDecoder;
}
 
开发者ID:altiplanogao,项目名称:io-comparison,代码行数:5,代码来源:MsgCodecFactory.java

示例7: getDecoder

import org.apache.mina.filter.codec.ProtocolDecoder; //导入依赖的package包/类
public ProtocolDecoder getDecoder() {
    return decoder;
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:4,代码来源:MinaCodecAdapter.java

示例8: getDecoder

import org.apache.mina.filter.codec.ProtocolDecoder; //导入依赖的package包/类
public ProtocolDecoder getDecoder(IoSession session) {
    return decoder;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:4,代码来源:ObjectSerializationCodecFactory.java

示例9: getDecoder

import org.apache.mina.filter.codec.ProtocolDecoder; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
public ProtocolDecoder getDecoder(IoSession session) throws Exception {
    return decoder;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:7,代码来源:DemuxingProtocolCodecFactory.java

示例10: getDecoder

import org.apache.mina.filter.codec.ProtocolDecoder; //导入依赖的package包/类
public ProtocolDecoder getDecoder(IoSession session) throws Exception {
    return decoder;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:4,代码来源:PrefixedStringCodecFactory.java

示例11: getDecoder

import org.apache.mina.filter.codec.ProtocolDecoder; //导入依赖的package包/类
public ProtocolDecoder getDecoder() throws Exception {
    return decoder;
}
 
开发者ID:NovaStory,项目名称:AeroStory,代码行数:4,代码来源:GMCodecFactory.java

示例12: getDecoder

import org.apache.mina.filter.codec.ProtocolDecoder; //导入依赖的package包/类
@Override
public ProtocolDecoder getDecoder() throws Exception {
    return decoder;
}
 
开发者ID:ergothvs,项目名称:Lucid2.0,代码行数:5,代码来源:MapleCodecFactory.java

示例13: getDecoder

import org.apache.mina.filter.codec.ProtocolDecoder; //导入依赖的package包/类
@Override
public ProtocolDecoder getDecoder(IoSession session) throws Exception {
    return decoder;
}
 
开发者ID:Keybo1013,项目名称:mina,代码行数:5,代码来源:CommandCodecFactory.java

示例14: getDecoder

import org.apache.mina.filter.codec.ProtocolDecoder; //导入依赖的package包/类
@Override
public ProtocolDecoder getDecoder(IoSession session) throws Exception {
	return decoder;
}
 
开发者ID:youtongluan,项目名称:sumk,代码行数:5,代码来源:SumkCodecFactory.java

示例15: getDecoder

import org.apache.mina.filter.codec.ProtocolDecoder; //导入依赖的package包/类
/**
 * 返回一个新的(或可重复使用的)ProtocolDecoder实例
 */
public ProtocolDecoder getDecoder(IoSession session) throws Exception {
	return decoder;
}
 
开发者ID:lijian17,项目名称:androidpn-server,代码行数:7,代码来源:XmppCodecFactory.java


注:本文中的org.apache.mina.filter.codec.ProtocolDecoder类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。