當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。