protected final ByteBuffer parseContent ( ByteBuffer in ) throws BaseExceptions . ParserException { if ( contentComplete ( ) ) { throw new BaseExceptions . InvalidState ( "content already complete: " + _endOfContent ) ; } else { switch ( _endOfContent ) { case UNKNOWN_CONTENT : // This makes sense only for response parsing. Requests must always have // either Content-Length or Transfer-Encoding _endOfContent = EndOfContent . EOF_CONTENT ; _contentLength = Long . MAX_VALUE ; // Its up to the user to limit a body size return parseContent ( in ) ; case CONTENT_LENGTH : case EOF_CONTENT : return nonChunkedContent ( in ) ; case CHUNKED_CONTENT : return chunkedContent ( in ) ; default : throw new BaseExceptions . InvalidState ( "not implemented: " + _endOfContent ) ; } } }
Parses the buffer into body content