//
/**
- * Incremets the counter in {@link #incomingMessageStatistics} by <cod>1</code>
- * for the given message name.
+ * Incremets the counter in {@link #incomingMessageStatistics} by
+ * <cod>1</code> for the given message name.
*
* @param name
* The name of the message to count
* The length of the stream
* @return The limited input stream
*/
- private LimitedInputStream getInputStream(long dataLength) {
+ private synchronized LimitedInputStream getInputStream(long dataLength) {
if (dataLength <= 0) {
return new LimitedInputStream(null, 0);
}
* @throws IOException
* if an I/O error occurs
*/
- public void consume() throws IOException {
+ public synchronized void consume() throws IOException {
while (remaining > 0) {
skip(remaining);
}