JmsMsgType(String mime){ this.mime = (ascii(mime)); } }
JmsMsgType(String mime){ this.mime = (ascii(mime)); } }
@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); } }
private void setLongHeader(AsciiBuffer key, Long value) { if(value==null) { getHeaderMap().remove(key); } else { getHeaderMap().put(key, ascii(value.toString())); } }
private void setIntegerHeader(AsciiBuffer key, Integer value) { if(value==null) { getHeaderMap().remove(key); } else { getHeaderMap().put(key, ascii(value.toString())); } }
private void setLongHeader(AsciiBuffer key, Long value) { if(value==null) { getHeaderMap().remove(key); } else { getHeaderMap().put(key, ascii(value.toString())); } }
private void setIntegerHeader(AsciiBuffer key, Integer value) { if(value==null) { getHeaderMap().remove(key); } else { getHeaderMap().put(key, ascii(value.toString())); } }
@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); } }
private void setStringHeader(AsciiBuffer key, String value) { if(value==null) { getHeaderMap().remove(key); } else { getHeaderMap().put(key, ascii(value)); } }
private void setStringHeader(AsciiBuffer key, String value) { if(value==null) { getHeaderMap().remove(key); } else { getHeaderMap().put(key, ascii(value)); } }
private void setDestinationHeader(AsciiBuffer key, StompJmsDestination value) { if(value==null) { getHeaderMap().remove(key); } else { getHeaderMap().put(key, ascii(value.toString())); } }
private void setDestinationHeader(AsciiBuffer key, StompJmsDestination value) { if(value==null) { getHeaderMap().remove(key); } else { getHeaderMap().put(key, ascii(value.toString())); } }
public String toString() { return toBuffer(false).ascii().toString(); }
public String toString() { return toBuffer(false).ascii().toString(); }
private void setBytesHeader(AsciiBuffer key, byte[] value) { if(value==null) { getHeaderMap().remove(key); } else { getHeaderMap().put(key, new Buffer(value).deepCopy().ascii()); } }
private void setBytesHeader(AsciiBuffer key, byte[] value) { if(value==null) { getHeaderMap().remove(key); } else { getHeaderMap().put(key, new Buffer(value).deepCopy().ascii()); } }
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; } };
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; } };
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(); }
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(); }