com.thomsonreuters.upa.codec.Buffer.position()方法的使用及代码示例

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

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

Buffer.position介绍

[英]Returns the initial position of the buffer.
[中]返回缓冲区的初始位置。

代码示例

代码示例来源:origin: Refinitiv/Elektron-SDK

@Override
public int extractDomainType()
{
  if (MSG_TYPE_POS + MSG_TYPE_SIZE > _buffer.length())
    return CodecReturnCodes.INCOMPLETE_DATA;
  int position = _buffer.data().position();
  byte msgDomain = _buffer.data().get(_buffer.position() + MSG_TYPE_POS);
  _buffer.data().position(position);
  return msgDomain;
}

代码示例来源:origin: Refinitiv/Elektron-SDK

@Override
public int extractMsgClass()
{
  if (MSG_CLASS_POS + MSG_CLASS_SIZE > _buffer.length())
    return CodecReturnCodes.INCOMPLETE_DATA;
  int position = _buffer.data().position();
  byte msgClass = _buffer.data().get(_buffer.position() + MSG_CLASS_POS);
  _buffer.data().position(position);
  return msgClass;
}

代码示例来源:origin: Refinitiv/Elektron-SDK

@Override
public int extractStreamId()
{
  if (MSG_STREAMID_POS + MSG_STREAMID_SIZE > _buffer.length())
    return CodecReturnCodes.INCOMPLETE_DATA;
  int position = _buffer.data().position();
  int streamId = _buffer.data().getInt(_buffer.position() + MSG_STREAMID_POS);
  _buffer.data().position(position);
  return streamId;
}

代码示例来源:origin: Refinitiv/Elektron-SDK

@Override
public void sourceName(Buffer sourceName)
{
  _sourceName.data(sourceName.data(), sourceName.position(), sourceName.length());
}

代码示例来源:origin: Refinitiv/Elektron-SDK

@Override
public void encodedDataBody(Buffer data)
{
  _dataBuffer.data(data.data(), data.position(), data.length());
}

代码示例来源:origin: Refinitiv/Elektron-SDK

@Override
public void encodedDataBody(Buffer data)
{
  _dataBuffer.data(data.data(), data.position(), data.length());
}

代码示例来源:origin: Refinitiv/Elektron-SDK

public void dictionaryName(Buffer dictionaryName)
{
  assert (dictionaryName != null) : "dictionaryName can not be null";
  this.dictionaryName.data(dictionaryName.data(), dictionaryName.position(), dictionaryName.length());
}

代码示例来源:origin: Refinitiv/Elektron-SDK

/**
 * Sets group for this service to the user specified buffer. Data
 * and position of group buffer of this service will be set to passed in
 * buffer's data and position. Note that this creates garbage if buffer
 * is backed by String object.
 *
 * @param group the group
 */
public void group(Buffer group)
{
  this.group.data(group.data(), group.position(), group.length());
}

代码示例来源:origin: Refinitiv/Elektron-SDK

/**
 * Sets the mergedToGroup for this service to the user specified buffer.
 * Buffer used by this object's mergedToGroup field will be set to
 * passed in buffer's data and position. Note that this creates garbage
 * if buffer is backed by String object.
 *
 * @param mergedToGroup the merged to group
 */
public void mergedToGroup(Buffer mergedToGroup)
{
  this.mergedToGroup.data(mergedToGroup.data(), mergedToGroup.position(), mergedToGroup.length());
}

代码示例来源:origin: Refinitiv/Elektron-SDK

@Override
public void sourceName(Buffer sourceName)
{
  _sourceName.data(sourceName.data(), sourceName.position(), sourceName.length());
}

代码示例来源:origin: Refinitiv/Elektron-SDK

/**
 * Sets encoded data for this service to the user specified
 * buffer. Data and position of encoded data of this service will be set
 * to passed in buffer's data and position. Note that this creates
 * garbage if buffer is backed by String object.
 *
 * @param data the data
 */
public void data(Buffer data)
{
  this.data.data(data.data(), data.position(), data.length());
}

代码示例来源:origin: Refinitiv/Elektron-SDK

public void authenticationExtendedResp(Buffer authenticationExtendedResp)
{
  assert (checkHasAuthenticationExtendedResp());
  authenticationExtendedResp.data(authenticationExtendedResp.data(),
                  authenticationExtendedResp.position(),
                  authenticationExtendedResp.length());
}

代码示例来源:origin: Refinitiv/Elektron-SDK

/**
 * Sets hostName for the server. Note that this creates garbage if
 * buffer is backed by String object.
 * 
 * @param hostName to connect to.
 */
public void hostName(Buffer hostName)
{
  assert (hostName != null) : "hostName can not be null";
  hostName().data(hostName.data(), hostName.position(), hostName.length());
}

代码示例来源:origin: Refinitiv/Elektron-SDK

public void userName(Buffer userName)
{
  assert (userName != null) : "userName can not be null";
  userName().data(userName.data(), userName.position(), userName.length());
}

代码示例来源:origin: Refinitiv/Elektron-SDK

public void authenticationErrorText(Buffer authenticationErrorText)
{
  assert (checkHasAuthenticationErrorText());
  authenticationErrorText.data(authenticationErrorText.data(),
                 authenticationErrorText.position(),
                 authenticationErrorText.length());
}

代码示例来源:origin: Refinitiv/Elektron-SDK

public void userName(Buffer userName)
{
  assert(userName != null) : "userName can not be null";
  userName().data(userName.data(), userName.position(), userName.length());
}

代码示例来源:origin: Refinitiv/Elektron-SDK

public void containerOverrunTest_decodeOpaque(Buffer encData, ByteBuffer sampleDataBuf, int dataSize)
{
  assertEquals(dataSize, encData.length());
  sampleDataBuf.limit(dataSize);
  
  ByteBuffer tmpByteBuf = encData.data().duplicate();
  
  tmpByteBuf.position(encData.position());
  tmpByteBuf.limit(encData.position() + encData.length());
  
  assertTrue(tmpByteBuf.equals(sampleDataBuf));
}

代码示例来源:origin: Refinitiv/Elektron-SDK

public void authenticationExtended(Buffer authenticationExtended)
{
  assert (authenticationExtended != null) : "authenticationExtended can not be null";
  assert (checkHasAuthenticationExtended()) : "authenticationExtended flag should be set first";
  authenticationExtended().data(authenticationExtended.data(),
                 authenticationExtended.position(),
                 authenticationExtended.length());
}

代码示例来源:origin: Refinitiv/Elektron-SDK

public void applicationId(Buffer applicationId)
{
  assert(checkHasApplicationId()) : "application id flag should be set first";
  assert (applicationId != null) : "applicationId can not be null";
  applicationId().data(applicationId.data(), applicationId.position(), applicationId.length());
}

代码示例来源:origin: Refinitiv/Elektron-SDK

public void position(Buffer position)
  {
    assert(checkHasPosition()) : "position flag should be set first";
    assert (position != null) : "position can not be null";

    position().data(position.data(), position.position(), position.length());
  }
}

相关文章