本文整理了Java中org.apache.qpid.proton.amqp.Binary.getArrayOffset()
方法的一些代码示例,展示了Binary.getArrayOffset()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Binary.getArrayOffset()
方法的具体详情如下:
包路径:org.apache.qpid.proton.amqp.Binary
类名称:Binary
方法名:getArrayOffset
暂无
代码示例来源: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: Azure/azure-event-hubs-java
private void writeObject(ObjectOutputStream out) throws IOException {
out.defaultWriteObject();
out.writeInt(this.bodyData == null ? BODY_DATA_NULL : this.bodyData.getLength());
if (this.bodyData != null)
out.write(this.bodyData.getArray(), this.bodyData.getArrayOffset(), this.bodyData.getLength());
}
代码示例来源: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/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: org.apache.qpid/proton-j-impl
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: apache/qpid-jms
@Override
public byte[] getUserIdBytes() {
if(properties == null || properties.getUserId() == null) {
return null;
} else {
final Binary userId = properties.getUserId();
byte[] id = new byte[userId.getLength()];
System.arraycopy(userId.getArray(), userId.getArrayOffset(), id, 0, userId.getLength());
return id;
}
}
代码示例来源: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 byte[] getUserIdBytes() {
if(properties == null || properties.getUserId() == null) {
return null;
} else {
final Binary userId = properties.getUserId();
byte[] id = new byte[userId.getLength()];
System.arraycopy(userId.getArray(), userId.getArrayOffset(), id, 0, userId.getLength());
return id;
}
}
代码示例来源:origin: org.apache.qpid/proton-j-impl
@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: 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
/**
* 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();
}
代码示例来源: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: 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());
}
内容来源于网络,如有侵权,请联系作者删除!