Dear Wiki user, You have subscribed to a wiki page or wiki category on "Httpcomponents Wiki" for change notification.
The following page has been changed by OlegKalnichevski: http://wiki.apache.org/HttpComponents/HttpCoreTutorial ------------------------------------------------------------------------------ == HTTP message parsing and formatting framework == - HTTP message processing framework has been designed to be expressive and flexible while remaining memory efficient and fast. !HttpCore HTTP message processing achieves near zero intermediate garbage and near zero-copy buffering for most of its parsing and formatting operations. The same HTTP message parsing and formatting API and implementations are used by both blocking and non-blocking transport implementations, which helps ensure a consistent behaviour of HTTP services regardless of I/O model. + HTTP message processing framework is designed to be expressive and flexible while remaining memory efficient and fast. !HttpCore HTTP message processing code achieves near zero intermediate garbage and near zero-copy buffering for its parsing and formatting operations. The same HTTP message parsing and formatting API and implementations are used by both the blocking and non-blocking transport implementations, which helps ensure a consistent behaviour of HTTP services regardless of the I/O model. === HTTP line parsing and formatting === - !HttpCore consistently utilizes a small number of low level components for all its line parsing and formatting methods. + !HttpCore utilizes a number of low level components for all its line parsing and formatting methods. !CharArrayBuffer represents a sequence of characters, usually a single line in an HTTP message stream such as a request line, a status line or a header. Internally !CharArrayBuffer is backed by an array of chars, which can be expanded to accommodate more input if needed. !CharArrayBuffer also provides a number of utility methods for manipulating content of the buffer, storing more data and retrieving subsets of data. @@ -1752, +1752 @@ [0>7>14] }}} - !LineParser is the interface for parsing lines in the HEAD section of an HTTP message. There are individual methods for parsing a request line, a status line, or a header line. The lines to parse are passed in memory, the parser does not depend on any specific I/O mechanism. Instances of this interface are expected to be stateless and thread-safe. + !LineParser is the interface for parsing lines in the HEAD section of an HTTP message. There are individual methods for parsing a request line, a status line, or a header line. The lines to parse are passed in memory, the parser does not depend on any specific I/O mechanism. {{{ CharArrayBuffer buf = new CharArrayBuffer(64); @@ -1785, +1785 @@ OK }}} - !LineFormatter for formatting elements of the HEAD section of an HTTP message. This is the complement to !LineParser. There are individual methods for formatting a request line, a status line, or a header line. Instances of this interface are expected to be stateless and thread-safe. + !LineFormatter for formatting elements of the HEAD section of an HTTP message. This is the complement to !LineParser. There are individual methods for formatting a request line, a status line, or a header line. Please note the formatting does not include the trailing line break sequence CR-LF. @@ -1804, +1804 @@ Content-Type: text/plain }}} - !HeaderValueParser is the interface for parsing header values into elements. Instances of this interface are expected to be stateless and thread-safe. + !HeaderValueParser is the interface for parsing header values into elements. {{{ CharArrayBuffer buf = new CharArrayBuffer(64); @@ -1823, +1823 @@ name3=value3 }}} - !HeaderValueFormatter is the interface for formatting elements of a header value. This is the complement to !HeaderValueParser. Instances of this interface are expected to be stateless and thread-safe. + !HeaderValueFormatter is the interface for formatting elements of a header value. This is the complement to !HeaderValueParser. {{{ CharArrayBuffer buf = new CharArrayBuffer(64); @@ -1845, +1845 @@ === HTTP message streams and session I/O buffers === - !HttpCore provides a number of utility classes for blocking and non-blocking I/O models that facilitate the processing of HTTP message streams, simplify handling of line-based structures in HTTP messages and manage intermediate data buffering. + !HttpCore provides a number of utility classes for the blocking and non-blocking I/O models that facilitate the processing of HTTP message streams, simplify handling of CR-LF delimited lines in HTTP messages and manage intermediate data buffering. HTTP connection implementations usually rely on session input/output buffers for reading and writing data from and to an HTTP message stream. Session input/output buffer implementations are I/O model specific and are optimized either for blocking or non-blocking operations. - Blocking HTTP connections use socket bound session buffers to transfer data. Session buffer interfaces are similar to !InputStream / !OutputStream classes, but they also provide methods for reading and writing CRLF delimited lines. + Blocking HTTP connections use socket bound session buffers to transfer data. Session buffer interfaces are similar to !InputStream / !OutputStream classes, but they also provide methods for reading and writing CR-LF delimited lines. {{{ Socket socket1; @@ -1863, +1863 @@ outbuffer.writeLine(linebuf); }}} - Non-blocking HTTP connections use session buffers optimized for reading and writing data from and to non-blocking NIO channels. NIO session input/output sessions help deal with CRLF delimited lines in a non-blocking I/O model. + Non-blocking HTTP connections use session buffers optimized for reading and writing data from and to non-blocking NIO channels. NIO session input/output sessions help deal with CR-LF delimited lines in a non-blocking I/O mode. {{{ ReadableByteChannel channel1; --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
