本文整理匯總了Java中org.apache.mina.core.buffer.IoBuffer.getString方法的典型用法代碼示例。如果您正苦於以下問題:Java IoBuffer.getString方法的具體用法?Java IoBuffer.getString怎麽用?Java IoBuffer.getString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.mina.core.buffer.IoBuffer
的用法示例。
在下文中一共展示了IoBuffer.getString方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: decodeProperties
import org.apache.mina.core.buffer.IoBuffer; //導入方法依賴的package包/類
private Map<String, String> decodeProperties ( final IoSession session, final IoBuffer data ) throws CharacterCodingException
{
final int count = data.getInt ();
final Map<String, String> result = new HashMap<String, String> ( count );
final CharsetDecoder decoder = getCharsetDecoder ( session );
for ( int i = 0; i < count; i++ )
{
final String key = data.getString ( decoder );
final String value = data.getString ( decoder );
result.put ( key, value );
}
return result;
}
示例2: get
import org.apache.mina.core.buffer.IoBuffer; //導入方法依賴的package包/類
@Override
public String get ( final IoBuffer data, final int index )
{
try
{
return data.getString ( this.length, this.charset.newDecoder () );
}
catch ( final CharacterCodingException e )
{
throw new RuntimeException ( e );
}
}
示例3: decodeCloseFrame
import org.apache.mina.core.buffer.IoBuffer; //導入方法依賴的package包/類
private CloseMessage decodeCloseFrame ( final IoSession session, final IoBuffer data ) throws CharacterCodingException
{
return new CloseMessage ( data.getString ( getCharsetDecoder ( session ) ), data.getInt () );
}