本文整理了Java中org.fusesource.hawtbuf.Buffer.ascii()
方法的一些代码示例,展示了Buffer.ascii()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Buffer.ascii()
方法的具体详情如下:
包路径:org.fusesource.hawtbuf.Buffer
类名称:Buffer
方法名:ascii
暂无
代码示例来源:origin: fusesource/stompjms
JmsMsgType(String mime){
this.mime = (ascii(mime));
}
}
代码示例来源:origin: org.fusesource.stompjms/stompjms-client
JmsMsgType(String mime){
this.mime = (ascii(mime));
}
}
代码示例来源:origin: org.apache.activemq/activemq-all
@Override
public String toString() {
int size = length;
boolean asciiPrintable = true;
for( int i=0; i < size; i++ ) {
int c = data[offset+i] & 0xFF;
if( c > 126 || c < 32 ) { // not a printable char
if( !(c=='\n' || c=='\r' | c=='\n' | c==27) ) { // except these.
asciiPrintable = false;
break;
}
}
}
if( asciiPrintable ) {
return "ascii: "+ascii();
} else {
return "hex: "+HexSupport.toHexFromBuffer(this);
}
}
代码示例来源:origin: fusesource/stompjms
private void setLongHeader(AsciiBuffer key, Long value) {
if(value==null) {
getHeaderMap().remove(key);
} else {
getHeaderMap().put(key, ascii(value.toString()));
}
}
代码示例来源:origin: org.fusesource.stompjms/stompjms-client
private void setIntegerHeader(AsciiBuffer key, Integer value) {
if(value==null) {
getHeaderMap().remove(key);
} else {
getHeaderMap().put(key, ascii(value.toString()));
}
}
代码示例来源:origin: org.fusesource.stompjms/stompjms-client
private void setLongHeader(AsciiBuffer key, Long value) {
if(value==null) {
getHeaderMap().remove(key);
} else {
getHeaderMap().put(key, ascii(value.toString()));
}
}
代码示例来源:origin: fusesource/stompjms
private void setIntegerHeader(AsciiBuffer key, Integer value) {
if(value==null) {
getHeaderMap().remove(key);
} else {
getHeaderMap().put(key, ascii(value.toString()));
}
}
代码示例来源:origin: org.fusesource.hawtbuf/hawtbuf
@Override
public String toString() {
int size = length;
boolean asciiPrintable = true;
for( int i=0; i < size; i++ ) {
int c = data[offset+i] & 0xFF;
if( c > 126 || c < 32 ) { // not a printable char
if( !(c=='\n' || c=='\r' | c=='\n' | c==27) ) { // except these.
asciiPrintable = false;
break;
}
}
}
if( asciiPrintable ) {
return "ascii: "+ascii();
} else {
return "hex: "+HexSupport.toHexFromBuffer(this);
}
}
代码示例来源:origin: org.fusesource.stompjms/stompjms-client
private void setStringHeader(AsciiBuffer key, String value) {
if(value==null) {
getHeaderMap().remove(key);
} else {
getHeaderMap().put(key, ascii(value));
}
}
代码示例来源:origin: fusesource/stompjms
private void setStringHeader(AsciiBuffer key, String value) {
if(value==null) {
getHeaderMap().remove(key);
} else {
getHeaderMap().put(key, ascii(value));
}
}
代码示例来源:origin: fusesource/stompjms
private void setDestinationHeader(AsciiBuffer key, StompJmsDestination value) {
if(value==null) {
getHeaderMap().remove(key);
} else {
getHeaderMap().put(key, ascii(value.toString()));
}
}
代码示例来源:origin: org.fusesource.stompjms/stompjms-client
private void setDestinationHeader(AsciiBuffer key, StompJmsDestination value) {
if(value==null) {
getHeaderMap().remove(key);
} else {
getHeaderMap().put(key, ascii(value.toString()));
}
}
代码示例来源:origin: org.fusesource.stompjms/stompjms-client
public String toString() {
return toBuffer(false).ascii().toString();
}
代码示例来源:origin: fusesource/stompjms
public String toString() {
return toBuffer(false).ascii().toString();
}
代码示例来源:origin: org.fusesource.stompjms/stompjms-client
private void setBytesHeader(AsciiBuffer key, byte[] value) {
if(value==null) {
getHeaderMap().remove(key);
} else {
getHeaderMap().put(key, new Buffer(value).deepCopy().ascii());
}
}
代码示例来源:origin: fusesource/stompjms
private void setBytesHeader(AsciiBuffer key, byte[] value) {
if(value==null) {
getHeaderMap().remove(key);
} else {
getHeaderMap().put(key, new Buffer(value).deepCopy().ascii());
}
}
代码示例来源:origin: org.fusesource.stompjms/stompjms-client
public Object apply() throws IOException {
Buffer line = readUntil((byte) '\n', max_command_length, "The maximum command length was exceeded");
if (line != null) {
Buffer action = line.moveTail(-1);
if (trim) {
action = action.trim();
}
if (action.length() > 0) {
StompFrame frame = new StompFrame(action.ascii());
nextDecodeAction = read_headers(frame);
return nextDecodeAction.apply();
}
}
return null;
}
};
代码示例来源:origin: fusesource/stompjms
public Object apply() throws IOException {
Buffer line = readUntil((byte) '\n', max_command_length, "The maximum command length was exceeded");
if (line != null) {
Buffer action = line.moveTail(-1);
if (trim) {
action = action.trim();
}
if (action.length() > 0) {
StompFrame frame = new StompFrame(action.ascii());
nextDecodeAction = read_headers(frame);
return nextDecodeAction.apply();
}
}
return null;
}
};
代码示例来源:origin: org.fusesource.stompjms/stompjms-client
private AsciiBuffer getNextMessageId() throws JMSException {
AsciiBuffer session = null;
if(channel!=null) {
session = channel.sessionId();
} else {
session = connection.getChannel().sessionId();
}
AsciiBuffer id = ascii(Long.toString(nextMessageSwquence++));
ByteArrayOutputStream out = new ByteArrayOutputStream(3+session.length() + 1 + id.length());
out.write('I');
out.write('D');
out.write(':');
out.write(session);
out.write('-');
out.write(id);
return out.toBuffer().ascii();
}
代码示例来源:origin: fusesource/stompjms
private AsciiBuffer getNextMessageId() throws JMSException {
AsciiBuffer session = null;
if(channel!=null) {
session = channel.sessionId();
} else {
session = connection.getChannel().sessionId();
}
AsciiBuffer id = ascii(Long.toString(nextMessageSwquence++));
ByteArrayOutputStream out = new ByteArrayOutputStream(3+session.length() + 1 + id.length());
out.write('I');
out.write('D');
out.write(':');
out.write(session);
out.write('-');
out.write(id);
return out.toBuffer().ascii();
}
内容来源于网络,如有侵权,请联系作者删除!