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

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

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

WritableBuffer.putShort介绍

暂无

代码示例

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

  1. void writeRaw(final short s)
  2. {
  3. _buffer.putShort(s);
  4. }

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

  1. void writeRaw(final short s)
  2. {
  3. _buffer.putShort(s);
  4. }

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

  1. void writeRaw(final short s)
  2. {
  3. _buffer.putShort(s);
  4. }

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

  1. void writeRaw(final short s)
  2. {
  3. _buffer.putShort(s);
  4. }

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

  1. @Override
  2. public void putShort(short s)
  3. {
  4. int remaining = _first.remaining();
  5. if(remaining >= 2)
  6. {
  7. _first.putShort(s);
  8. }
  9. else if(remaining ==0 )
  10. {
  11. _second.putShort(s);
  12. }
  13. else
  14. {
  15. ByteBuffer wrap = ByteBuffer.wrap(new byte[2]);
  16. wrap.putShort(s);
  17. wrap.flip();
  18. put(wrap);
  19. }
  20. }

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

  1. public void putShort(short s)
  2. {
  3. int remaining = _first.remaining();
  4. if(remaining >= 2)
  5. {
  6. _first.putShort(s);
  7. }
  8. else if(remaining ==0 )
  9. {
  10. _second.putShort(s);
  11. }
  12. else
  13. {
  14. ByteBuffer wrap = ByteBuffer.wrap(new byte[2]);
  15. wrap.putShort(s);
  16. wrap.flip();
  17. put(wrap);
  18. }
  19. }

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

  1. public void putShort(short s)
  2. {
  3. int remaining = _first.remaining();
  4. if(remaining >= 2)
  5. {
  6. _first.putShort(s);
  7. }
  8. else if(remaining ==0 )
  9. {
  10. _second.putShort(s);
  11. }
  12. else
  13. {
  14. ByteBuffer wrap = ByteBuffer.wrap(new byte[2]);
  15. wrap.putShort(s);
  16. wrap.flip();
  17. put(wrap);
  18. }
  19. }

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

  1. public void putShort(short s)
  2. {
  3. int remaining = _first.remaining();
  4. if(remaining >= 2)
  5. {
  6. _first.putShort(s);
  7. }
  8. else if(remaining ==0 )
  9. {
  10. _second.putShort(s);
  11. }
  12. else
  13. {
  14. ByteBuffer wrap = ByteBuffer.wrap(new byte[2]);
  15. wrap.putShort(s);
  16. wrap.flip();
  17. put(wrap);
  18. }
  19. }

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

  1. private void endFrame(int channel)
  2. {
  3. int frameSize = _buffer.position() - _frameStart;
  4. int limit = _buffer.position();
  5. _buffer.position(_frameStart);
  6. _buffer.putInt(frameSize);
  7. _buffer.put((byte) 2);
  8. _buffer.put(_frameType);
  9. _buffer.putShort((short) channel);
  10. _buffer.position(limit);
  11. int offset = _bbuf.arrayOffset() + _frameStart;
  12. //System.out.println("RAW: \"" + new Binary(_bbuf.array(), offset, frameSize) + "\"");
  13. }

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

  1. private void endFrame(int channel)
  2. {
  3. int frameSize = _buffer.position() - _frameStart;
  4. int limit = _buffer.position();
  5. _buffer.position(_frameStart);
  6. _buffer.putInt(frameSize);
  7. _buffer.put((byte) 2);
  8. _buffer.put(_frameType);
  9. _buffer.putShort((short) channel);
  10. _buffer.position(limit);
  11. }

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

  1. buffer.put((byte) 2);
  2. buffer.put(AMQP_FRAME_TYPE);
  3. buffer.putShort((short) channel);
  4. buffer.position(limit);

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

  1. int writeFrame(WritableBuffer buffer, SaslFrameBody frameBody)
  2. {
  3. int oldPosition = buffer.position();
  4. buffer.position(buffer.position()+8);
  5. _encoder.setByteBuffer(buffer);
  6. _encoder.writeObject(frameBody);
  7. int frameSize = buffer.position() - oldPosition;
  8. int limit = buffer.position();
  9. buffer.position(oldPosition);
  10. buffer.putInt(frameSize);
  11. buffer.put((byte) 2);
  12. buffer.put(SASL_FRAME_TYPE);
  13. buffer.putShort((short) 0);
  14. buffer.position(limit);
  15. return frameSize;
  16. }

相关文章