本文整理了Java中org.fusesource.hawtbuf.Buffer.utf8()
方法的一些代码示例,展示了Buffer.utf8()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Buffer.utf8()
方法的具体详情如下:
包路径:org.fusesource.hawtbuf.Buffer
类名称:Buffer
方法名:utf8
暂无
代码示例来源:origin: fusesource/mqtt-client
public void setPassword(String password) {
this.setPassword(utf8(password));
}
public void setPassword(UTF8Buffer password) {
代码示例来源:origin: fusesource/mqtt-client
public void setUserName(String userName) {
this.setUserName(utf8(userName));
}
public void setUserName(UTF8Buffer userName) {
代码示例来源:origin: fusesource/mqtt-client
public void setWillTopic(String willTopic) {
this.setWillTopic(utf8(willTopic));
}
public void setWillTopic(UTF8Buffer willTopic) {
代码示例来源:origin: fusesource/mqtt-client
public void setClientId(String clientId) {
this.setClientId(utf8(clientId));
}
public void setClientId(UTF8Buffer clientId) {
代码示例来源:origin: fusesource/mqtt-client
public void setWillMessage(String willMessage) {
connect.willMessage(utf8(willMessage));
}
public void setWillMessage(UTF8Buffer willMessage) {
代码示例来源:origin: fusesource/mqtt-client
public void publish(final String topic, final byte[] payload, final QoS qos, final boolean retain) throws Exception {
publish(utf8(topic), new Buffer(payload), qos, retain);
}
代码示例来源:origin: fusesource/mqtt-client
public void publish(String topic, byte[] payload, QoS qos, boolean retain, Callback<Void> cb) {
publish(utf8(topic), new Buffer(payload), qos, retain, cb);
}
代码示例来源:origin: fusesource/mqtt-client
public Future<Void> publish(final String topic, final byte[] payload, final QoS qos, final boolean retain) {
return publish(utf8(topic), new Buffer(payload), qos, retain);
}
代码示例来源:origin: fusesource/mqtt-client
static protected UTF8Buffer readUTF(DataByteArrayInputStream is) throws ProtocolException {
int size = is.readUnsignedShort();
Buffer buffer = is.readBuffer(size);
if (buffer == null || buffer.length != size) {
throw new ProtocolException("Invalid message encoding");
}
return buffer.utf8();
}
代码示例来源:origin: fusesource/mqtt-client
id = id.substring(0,23);
mqtt.connect.clientId(utf8(id));
代码示例来源:origin: org.fusesource.mqtt-client/mqtt-client
public void setClientId(String clientId) {
this.setClientId(utf8(clientId));
}
public void setClientId(UTF8Buffer clientId) {
代码示例来源:origin: org.fusesource.mqtt-client/mqtt-client
public void setWillMessage(String willMessage) {
connect.willMessage(utf8(willMessage));
}
public void setWillMessage(UTF8Buffer willMessage) {
代码示例来源:origin: jboss-fuse/fabric8
public void set(Message message, Object value) throws OpenwireException {
String rc = (String) TypeConversionSupport.convert(value, String.class);
if (rc == null) {
throw new OpenwireException("Property JMSCorrelationID cannot be set from a " + value.getClass().getName() + ".");
}
message.setCorrelationId(utf8(rc));
}
});
代码示例来源:origin: jboss-fuse/fabric8
public void set(Message message, Object value) throws OpenwireException {
String rc = (String) TypeConversionSupport.convert(value, String.class);
if (rc == null) {
throw new OpenwireException("Property JMSXGroupID cannot be set from a " + value.getClass().getName() + ".");
}
message.setGroupID(utf8(rc));
}
});
代码示例来源:origin: io.fabric8/gateway-core
public void set(Message message, Object value) throws OpenwireException {
String rc = (String) TypeConversionSupport.convert(value, String.class);
if (rc == null) {
throw new OpenwireException("Property JMSXGroupID cannot be set from a " + value.getClass().getName() + ".");
}
message.setGroupID(utf8(rc));
}
});
代码示例来源:origin: io.fabric8/gateway-core
public void set(Message message, Object value) throws OpenwireException {
String rc = (String) TypeConversionSupport.convert(value, String.class);
if (rc == null) {
throw new OpenwireException("Property JMSType cannot be set from a " + value.getClass().getName() + ".");
}
message.setType(utf8(rc));
}
});
代码示例来源:origin: io.fabric8/gateway-core
public void set(Message message, Object value) throws OpenwireException {
String rc = (String) TypeConversionSupport.convert(value, String.class);
if (rc == null) {
throw new OpenwireException("Property JMSCorrelationID cannot be set from a " + value.getClass().getName() + ".");
}
message.setCorrelationId(utf8(rc));
}
});
代码示例来源:origin: org.eclipse.kapua/kapua-client-gateway-provider-fuse
@Override
public CompletionStage<?> publishMqtt(final String topic, final ByteBuffer payload) {
final CompletableFuture<Void> future = new CompletableFuture<>();
connection.publish(Buffer.utf8(topic), new Buffer(payload), QoS.AT_LEAST_ONCE, false, Callbacks.asCallback(future));
return future;
}
代码示例来源:origin: org.fusesource.mqtt-client/mqtt-client
static protected UTF8Buffer readUTF(DataByteArrayInputStream is) throws ProtocolException {
int size = is.readUnsignedShort();
Buffer buffer = is.readBuffer(size);
if (buffer == null || buffer.length != size) {
throw new ProtocolException("Invalid message encoding");
}
return buffer.utf8();
}
代码示例来源:origin: io.fabric8/gateway-core
protected UTF8Buffer looseUnmarshalString(DataByteArrayInputStream dataIn) throws IOException {
if (dataIn.readBoolean()) {
int size = dataIn.readShort();
return dataIn.readBuffer(size).utf8();
} else {
return null;
}
}
内容来源于网络,如有侵权,请联系作者删除!