org.apache.mina.common.ByteBuffer.getString()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(157)

本文整理了Java中org.apache.mina.common.ByteBuffer.getString()方法的一些代码示例,展示了ByteBuffer.getString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ByteBuffer.getString()方法的具体详情如下:
包路径:org.apache.mina.common.ByteBuffer
类名称:ByteBuffer
方法名:getString

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();

相关文章