本文整理了Java中org.apache.mina.common.ByteBuffer.getString()
方法的一些代码示例,展示了ByteBuffer.getString()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ByteBuffer.getString()
方法的具体详情如下:
包路径:org.apache.mina.common.ByteBuffer
类名称:ByteBuffer
方法名:getString
[英]Reads a NUL
-terminated string from this buffer using the specified decoder
and returns it.
[中]使用指定的decoder
从该缓冲区读取以NUL
结尾的字符串并返回该字符串。
代码示例来源:origin: org.apache.directory.mina/mina-core
public String getString( int fieldSize, CharsetDecoder decoder )
throws CharacterCodingException
{
return buf.getString( fieldSize, decoder );
}
代码示例来源:origin: org.apache.directory.mina/mina-core
public String getString( CharsetDecoder decoder )
throws CharacterCodingException
{
return buf.getString( decoder );
}
代码示例来源:origin: org.apache.directory.server/mitosis
protected BaseMessage decodeBody( Registries registries, int sequence, int bodyLength, int responseCode, ByteBuffer in ) throws Exception
{
return new LoginAckMessage( sequence, responseCode, in.getString( utf8decoder ) );
}
代码示例来源:origin: org.apache.directory.server/mitosis
protected BaseMessage decodeBody( Registries registries, int sequence, int bodyLength, ByteBuffer in ) throws Exception
{
return new LoginMessage( sequence, in.getString( utf8decoder ) );
}
代码示例来源:origin: org.apache.directory.server/mitosis
private void readCSNVector( ByteBuffer in, CSNVector updateVector ) throws Exception
{
int nReplicas = in.getInt();
if ( nReplicas < 0 )
{
throw new ProtocolDecoderException( "Wrong nReplicas: " + nReplicas );
}
for ( ; nReplicas > 0; nReplicas-- )
{
String replicaId;
try
{
replicaId = in.getString( utf8decoder );
}
catch ( CharacterCodingException e )
{
throw new ProtocolDecoderException( "Invalid replicaId", e );
}
updateVector.setCSN( new DefaultCSN( in.getLong(), replicaId, in.getInt() ) );
}
}
代码示例来源:origin: org.apache.directory.mina/mina-core
out.write( buf.getString( decoder ) );
buf.clear();
代码示例来源:origin: org.apache.directory.mina/mina-core
out.write( buf.getString( decoder ) );
buf.clear();
内容来源于网络,如有侵权,请联系作者删除!