org.apache.qpid.proton.codec.WritableBuffer.position()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(121)

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

WritableBuffer.position介绍

暂无

代码示例

代码示例来源:origin: org.apache.qpid/proton-j

@Override
public int position()
{
  return _first.position()+_second.position();
}

代码示例来源:origin: org.apache.qpid/proton-j-impl

public int position()
{
  return _first.position()+_second.position();
}

代码示例来源:origin: com.microsoft.azure.iot/proton-j-azure-iot

public int position()
{
  return _first.position()+_second.position();
}

代码示例来源:origin: org.apache.qpid/proton

public int position()
{
  return _first.position()+_second.position();
}

代码示例来源:origin: org.apache.qpid/proton-j-impl

private void startFrame()
{
  _frameStart = _buffer.position();
}

代码示例来源:origin: com.microsoft.azure.iot/proton-j-azure-iot

private void startFrame()
{
  _frameStart = _buffer.position();
}

代码示例来源:origin: org.apache.qpid/proton

public void position(int position)
{
  int first_limit = _first.limit();
  if( position <= first_limit )
  {
    _first.position(position);
    _second.position(0);
  }
  else
  {
    _first.position(first_limit);
    _second.position(position - first_limit);
  }
}

代码示例来源:origin: org.apache.qpid/proton-j

@Override
public void position(int position)
{
  int first_limit = _first.limit();
  if( position <= first_limit )
  {
    _first.position(position);
    _second.position(0);
  }
  else
  {
    _first.position(first_limit);
    _second.position(position - first_limit);
  }
}

代码示例来源:origin: org.apache.qpid/proton-j-impl

public void position(int position)
{
  int first_limit = _first.limit();
  if( position <= first_limit )
  {
    _first.position(position);
    _second.position(0);
  }
  else
  {
    _first.position(first_limit);
    _second.position(position - first_limit);
  }
}

代码示例来源:origin: com.microsoft.azure.iot/proton-j-azure-iot

public void position(int position)
{
  int first_limit = _first.limit();
  if( position <= first_limit )
  {
    _first.position(position);
    _second.position(0);
  }
  else
  {
    _first.position(first_limit);
    _second.position(position - first_limit);
  }
}

代码示例来源:origin: com.microsoft.azure.iot/proton-j-azure-iot

private void endFrame(int channel)
{
  int frameSize = _buffer.position() - _frameStart;
  int limit = _buffer.position();
  _buffer.position(_frameStart);
  _buffer.putInt(frameSize);
  _buffer.put((byte) 2);
  _buffer.put(_frameType);
  _buffer.putShort((short) channel);
  _buffer.position(limit);
}

代码示例来源:origin: org.apache.qpid/proton

int writeFrame(WritableBuffer buffer, SaslFrameBody frameBody)
{
  int oldPosition = buffer.position();
  buffer.position(buffer.position()+8);
  _encoder.setByteBuffer(buffer);
  _encoder.writeObject(frameBody);
  int frameSize = buffer.position() - oldPosition;
  int limit = buffer.position();
  buffer.position(oldPosition);
  buffer.putInt(frameSize);
  buffer.put((byte) 2);
  buffer.put(SASL_FRAME_TYPE);
  buffer.putShort((short) 0);
  buffer.position(limit);
  return frameSize;
}

代码示例来源:origin: org.apache.qpid/proton-j-impl

private void endFrame(int channel)
{
  int frameSize = _buffer.position() - _frameStart;
  int limit = _buffer.position();
  _buffer.position(_frameStart);
  _buffer.putInt(frameSize);
  _buffer.put((byte) 2);
  _buffer.put(_frameType);
  _buffer.putShort((short) channel);
  _buffer.position(limit);
  int offset = _bbuf.arrayOffset() + _frameStart;
  //System.out.println("RAW: \"" + new Binary(_bbuf.array(), offset, frameSize) + "\"");
}

代码示例来源:origin: apache/activemq-artemis

@Override
public ReadableBuffer get(WritableBuffer target) {
 int start = target.position();
 if (buffer.hasArray()) {
   target.put(buffer.array(), buffer.arrayOffset() + buffer.readerIndex(), buffer.readableBytes());
 } else {
   target.put(buffer.nioBuffer());
 }
 int written = target.position() - start;
 buffer.readerIndex(buffer.readerIndex() + written);
 return this;
}

代码示例来源:origin: org.apache.qpid/qpid-jms-client

@Override
public ReadableBuffer get(WritableBuffer target) {
  int start = target.position();
  if (buffer.hasArray()) {
    target.put(buffer.array(), buffer.arrayOffset() + buffer.readerIndex(), buffer.readableBytes());
  } else {
    target.put(buffer.nioBuffer());
  }
  int written = target.position() - start;
  buffer.readerIndex(buffer.readerIndex() + written);
  return this;
}

代码示例来源:origin: org.apache.activemq/artemis-amqp-protocol

@Override
public ReadableBuffer get(WritableBuffer target) {
 int start = target.position();
 if (buffer.hasArray()) {
   target.put(buffer.array(), buffer.arrayOffset() + buffer.readerIndex(), buffer.readableBytes());
 } else {
   target.put(buffer.nioBuffer());
 }
 int written = target.position() - start;
 buffer.readerIndex(buffer.readerIndex() + written);
 return this;
}

代码示例来源:origin: io.vertx/vertx-proton

@Override
public ReadableBuffer get(WritableBuffer target) {
 int start = target.position();
 if (buffer.hasArray()) {
  target.put(buffer.array(), buffer.arrayOffset() + buffer.readerIndex(), buffer.readableBytes());
 } else {
  target.put(buffer.nioBuffer());
 }
 int written = target.position() - start;
 buffer.readerIndex(buffer.readerIndex() + written);
 return this;
}

代码示例来源:origin: apache/qpid-jms

@Override
public ReadableBuffer get(WritableBuffer target) {
  int start = target.position();
  if (buffer.hasArray()) {
    target.put(buffer.array(), buffer.arrayOffset() + buffer.readerIndex(), buffer.readableBytes());
  } else {
    target.put(buffer.nioBuffer());
  }
  int written = target.position() - start;
  buffer.readerIndex(buffer.readerIndex() + written);
  return this;
}

代码示例来源:origin: org.apache.qpid/proton-j-impl

private void writePerformative(Object frameBody)
{
  while (_buffer.remaining() < 8) {
    grow();
  }
  while (true)
  {
    try
    {
      _buffer.position(_frameStart + 8);
      _encoder.writeObject(frameBody);
      break;
    }
    catch (BufferOverflowException e)
    {
      grow();
    }
  }
  _payloadStart = _buffer.position();
  _performativeSize = _payloadStart - _frameStart;
}

代码示例来源:origin: com.microsoft.azure.iot/proton-j-azure-iot

private void writePerformative(Object frameBody)
{
  while (_buffer.remaining() < 8) {
    grow();
  }
  while (true)
  {
    try
    {
      _buffer.position(_frameStart + 8);
      if (frameBody != null) _encoder.writeObject(frameBody);
      break;
    }
    catch (BufferOverflowException e)
    {
      grow();
    }
  }
  _payloadStart = _buffer.position();
  _performativeSize = _payloadStart - _frameStart;
}

相关文章