{
decoder.headerName = holder.getString();
}
catch (UnsupportedEncodingException e)
{
throw new HornetQStompException("Encoding exception", e);
}
holder.reset();
decoder.inHeaderName = false;
decoder.headerBytesCopyStart = decoder.pos;
decoder.headerValueWhitespace = true;
}
}
decoder.whiteSpaceOnly = false;
break;
}
case StompDecoder.LN:
{
if (isEscaping)
{
holder.append(StompDecoder.NEW_LINE);
isEscaping = false;
}
else
{
holder.append(b);
}
break;
}
case StompDecoder.NEW_LINE:
{
if (decoder.whiteSpaceOnly)
{
// Headers are terminated by a blank line
decoder.readingHeaders = false;
break outer;
}
String headerValue;
try
{
headerValue = holder.getString();
}
catch (UnsupportedEncodingException e)
{
throw new HornetQStompException("Encoding exception.", e);
}
holder.reset();
decoder.headers.put(decoder.headerName, headerValue);