protected String parseAction(DataInput in) throws IOException { String action = null; // skip white space to next real action line while (true) { action = readLine(in, MAX_COMMAND_LENGTH, "The maximum command length was exceeded"); if (action == null) { throw new IOException("connection was closed"); } else { action = action.trim(); if (action.length() > 0) { break; } } } return action; }
protected String parseAction(DataInput in, AtomicLong frameSize) throws IOException { String action = null; // skip white space to next real action line while (true) { action = readLine(in, MAX_COMMAND_LENGTH, "The maximum command length was exceeded"); if (action == null) { throw new IOException("connection was closed"); } else { action = action.trim(); if (action.length() > 0) { break; } } } frameSize.addAndGet(action.length()); return action; }
protected String parseAction(DataInput in, AtomicLong frameSize) throws IOException { String action = null; // skip white space to next real action line while (true) { action = readLine(in, MAX_COMMAND_LENGTH, "The maximum command length was exceeded"); if (action == null) { throw new IOException("connection was closed"); } else { action = action.trim(); if (action.length() > 0) { break; } } } frameSize.addAndGet(action.length()); return action; }
protected String parseAction(DataInput in, AtomicLong frameSize) throws IOException { String action = null; // skip white space to next real action line while (true) { action = readLine(in, MAX_COMMAND_LENGTH, "The maximum command length was exceeded"); if (action == null) { throw new IOException("connection was closed"); } else { action = action.trim(); if (action.length() > 0) { break; } } } frameSize.addAndGet(action.length()); return action; }
protected HashMap<String, String> parseHeaders(DataInput in) throws IOException { HashMap<String, String> headers = new HashMap<String, String>(25); while (true) { String line = readLine(in, MAX_HEADER_LENGTH, "The maximum header length was exceeded"); if (line != null && line.trim().length() > 0) { if (headers.size() > MAX_HEADERS) { throw new ProtocolException("The maximum number of headers was exceeded", true); } try { int seperatorIndex = line.indexOf(Stomp.Headers.SEPERATOR); String name = line.substring(0, seperatorIndex).trim(); String value = line.substring(seperatorIndex + 1, line.length()).trim(); headers.put(name, value); } catch (Exception e) { throw new ProtocolException("Unable to parser header line [" + line + "]", true); } } else { break; } } return headers; }