Using TopCoder


Binary Stream Parser Version 1.0

STATUS KEY : Specification Design and Architecture Development and Testing Complete
  • Overview

    Reads binary data, scanning it for configurable delimiters.

  • Functionality

    Many binary file formats and network protocols delimit sections or elements with specific byte sequences. For instance, HTTP delimits header lines with a carriage return / line feed (CRLF) pair, and SMTP delimits the end of message data with “.”. These data streams are fundamentally binary, so Java InputStreams must be used to read them, but the Java platform does not provide built-in support for recognizing general delimiters in binary streams. The Binary Stream Parser extends the platform library to provide such support.

    Example: A program that reads raw HTTP messages configures the component with a [carriage return, line feed] sequence as a delimiter, and instructs it to filter out delimiters. It then uses bulk reads to read each line of the HTTP header and to observe when the header has been fully read. At that point, it reconfigures the stream with no delimiter, and hands it off for appropriate handling of the message body.

    Example: A program uses the component to assist it in reading a binary stream containing variable-length, record-oriented data. It configures the stream with a field delimiter and a record delimiter, allowing it to parse the stream field-by-field, while remaining aware of record boundarie
  • Technologies



    Version 1.0
Adobe Acrobat is required to view TopCoder Software specification documentation.

This component is a Base Component