org.apache.qpid.proton.amqp.Binary.getLength()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(98)

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

Binary.getLength介绍

暂无

代码示例

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

@Override
public BinaryEncoding getEncoding(final Binary val)
{
  return val.getLength() <= 255 ? _shortBinaryEncoding : _binaryEncoding;
}

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

@Override
protected int getEncodedValueSize(final Binary val)
{
  return val.getLength();
}

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

@Override
protected int getEncodedValueSize(final Binary val)
{
  return val.getLength();
}

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

@Override
protected int getEncodedValueSize(final Binary val)
{
  return val.getLength();
}

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

@Override
protected int getEncodedValueSize(final Binary val)
{
  return val.getLength();
}

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

BinaryElement(Element parent, Element prev, Binary b)
{
  super(parent, prev);
  byte[] data = new byte[b.getLength()];
  System.arraycopy(b.getArray(),b.getArrayOffset(),data,0,b.getLength());
  _value = new Binary(data);
}

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

@Override
public byte[] copyBody() {
  Binary content = getBinaryFromBody();
  byte[] result = new byte[content.getLength()];
  System.arraycopy(content.getArray(), content.getArrayOffset(), result, 0, content.getLength());
  return result;
}

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

BinaryElement(Element parent, Element prev, Binary b)
{
  super(parent, prev);
  byte[] data = new byte[b.getLength()];
  System.arraycopy(b.getArray(),b.getArrayOffset(),data,0,b.getLength());
  _value = new Binary(data);
}

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

@Override
public Object get(String key) {
  Object value = messageBodyMap.get(key);
  if (value instanceof Binary) {
    // Copy to a byte[], ensure we copy only the required portion.
    Binary bin = ((Binary) value);
    value = Arrays.copyOfRange(bin.getArray(), bin.getArrayOffset(), bin.getLength());
  }
  return value;
}

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

@Override
public String getUserId() {
  String userId = null;
  if (properties != null && properties.getUserId() != null) {
    Binary userIdBytes = properties.getUserId();
    if (userIdBytes.getLength() != 0) {
      userId = new String(userIdBytes.getArray(), userIdBytes.getArrayOffset(), userIdBytes.getLength(), StandardCharsets.UTF_8);
    }
  }
  return userId;
}

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

@Override
public boolean hasBody() {
  if (bytesOut != null) {
    return bytesOut.writtenBytes() > 0;
  } else {
    return getBinaryFromBody().getLength() != 0;
  }
}

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

@Override
protected void writeEncodedValue(final Binary val)
{
  getEncoder().getBuffer().ensureRemaining(val.getLength());
  getEncoder().writeRaw(val.getArray(), val.getArrayOffset(), val.getLength());
}

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

@Override
protected void writeEncodedValue(final Binary val)
{
  getEncoder().getBuffer().ensureRemaining(val.getLength());
  getEncoder().writeRaw(val.getArray(), val.getArrayOffset(), val.getLength());
}

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

@Override
protected void writeEncodedValue(final Binary val)
{
  getEncoder().writeRaw(val.getArray(), val.getArrayOffset(), val.getLength());
}

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

@Override
protected void writeEncodedValue(final Binary val)
{
  getEncoder().writeRaw(val.getArray(), val.getArrayOffset(), val.getLength());
}

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

@Override
protected void writeEncodedValue(final Binary val)
{
  getEncoder().writeRaw(val.getArray(), val.getArrayOffset(), val.getLength());
}

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

@Override
protected void writeEncodedValue(final Binary val)
{
  getEncoder().writeRaw(val.getArray(), val.getArrayOffset(), val.getLength());
}

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

@Override
public void encode() throws Exception {
 super.encode();
 getInnerMessage().getBodyBuffer().writeInt(payload.getLength());
 getInnerMessage().getBodyBuffer().writeBytes(payload.getArray(), payload.getArrayOffset(), payload.getLength());
}

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

@Override
public void encode() throws Exception {
 super.encode();
 getInnerMessage().getBodyBuffer().writeInt(payload.getLength());
 getInnerMessage().getBodyBuffer().writeBytes(payload.getArray(), payload.getArrayOffset(), payload.getLength());
}

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

/**
* Converts a Binary value to a long assuming that the contained value is
* stored in Big Endian encoding.
*
* @param value the Binary object whose payload is converted to a long.
* @return a long value constructed from the bytes of the Binary instance.
*/
public static long toLong(Binary value) {
 Buffer buffer = new Buffer(value.getArray(), value.getArrayOffset(), value.getLength());
 return buffer.bigEndianEditor().readLong();
}

相关文章