private T parseHeadLine() throws IOException, HttpException { if (this.lineBuf.isEmpty()) { this.emptyLineCount++; if (this.emptyLineCount >= this.messageConstraints.getMaxEmptyLineCount()) { throw new MessageConstraintException("Maximum empty line limit exceeded"); } return null; } return createMessage(this.lineBuf); }
private T parseHeadLine() throws IOException, HttpException { if (this.lineBuf.isEmpty()) { this.emptyLineCount++; if (this.emptyLineCount >= this.messageConstraints.getMaxEmptyLineCount()) { throw new MessageConstraintException("Maximum empty line limit exceeded"); } return null; } return createMessage(this.lineBuf); }
if (buf.isEmpty()) { return Collections.emptyList();
if (buf.isEmpty()) { return Collections.emptyList();
"CRLF expected at end of chunk"); if (!lineBuffer.isEmpty()) { throw new MalformedChunkCodingException( "Unexpected content at the end of chunk");
"CRLF expected at end of chunk"); if (!lineBuffer.isEmpty()) { throw new MalformedChunkCodingException( "Unexpected content at the end of chunk");
if (!this.lineBuf.isEmpty()) { throw new MalformedChunkCodingException("CRLF expected at end of chunk");
if (!this.lineBuf.isEmpty()) { throw new MalformedChunkCodingException("CRLF expected at end of chunk");
@Test public void testSimpleAppend() throws Exception { final CharArrayBuffer buffer = new CharArrayBuffer(16); Assert.assertEquals(16, buffer.capacity()); Assert.assertEquals(0, buffer.length()); final char[] b1 = buffer.toCharArray(); Assert.assertNotNull(b1); Assert.assertEquals(0, b1.length); Assert.assertTrue(buffer.isEmpty()); Assert.assertFalse(buffer.isFull()); final char[] tmp = new char[] { '1', '2', '3', '4'}; buffer.append(tmp, 0, tmp.length); Assert.assertEquals(16, buffer.capacity()); Assert.assertEquals(4, buffer.length()); Assert.assertFalse(buffer.isEmpty()); Assert.assertFalse(buffer.isFull()); final char[] b2 = buffer.toCharArray(); Assert.assertNotNull(b2); Assert.assertEquals(4, b2.length); for (int i = 0; i < tmp.length; i++) { Assert.assertEquals(tmp[i], b2[i]); Assert.assertEquals(tmp[i], buffer.charAt(i)); } Assert.assertEquals("1234", buffer.toString()); buffer.clear(); Assert.assertEquals(16, buffer.capacity()); Assert.assertEquals(0, buffer.length()); Assert.assertTrue(buffer.isEmpty()); Assert.assertFalse(buffer.isFull()); }