Browse Prior Art Database

Data buffer with integrated handling of reserved fields and variable length fields

IP.com Disclosure Number: IPCOM000013017D
Original Publication Date: 1999-Nov-01
Included in the Prior Art Database: 2003-Jun-12
Document File: 2 page(s) / 40K

Publishing Venue

IBM

Related People

Mike J Johnson: AUTHOR

Abstract

Data buffer classes having "put" (or append) and "get" functions are widely used; vectors and character strings are common examples. The methods built into these data buffer classes relieve the application programmer from tedious details like keeping track of the current insertion point and the current buffer size, expanding the buffer when it fills, etc. Data buffers such as these are often used to assemble data that is to be transmitted over a communications link or written to a file. The use of these pre-designed buffers can increase the application programmer's productivity. However, if the data format contains embedded control fields and the data length is variable, then these pre-designed buffers cannot be used directly. Instead, the application programmer must necessarily provide code that handles the control fields and the context of variable-length records. For example, Figure 1 shows a file format that is more or less tabular, but each block or "row" is a different length and contains a length field and a checksum field. When reading the data, the application program must keep track of current location pointer within the current block, moving it past the length and checksum fields of the next block. When writing the data, the program must again keep track of the current location in order to start a new block if the maximum block length would be exceeded by the current "put" operation. The checksum must also be calculated on a write, and validated on a read. Many file formats and several communication protocols have a similar structure. In addition to being more time-consuming and error-prone for the programmer, having the block structure in the application code means that the file structure is built into the code in multiple places, and an application has to be re-written if the underlying file structure changes. On the other hand, if the reserved fields are handled only at the file system level, then the application program does not have access to the control fields for such functions as debug tracing or statistical reporting on the block lengths, etc. Length 1 C hecksum 1 Record 1

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 52% of the total text.

Page 1 of 2

Data buffer with integrated handling of reserved fields and variable length fields

   Data buffer classes having "put" (or append) and "get" functions are widely used; vectors and character strings are common examples. The methods built into these data buffer classes relieve the application programmer from tedious details like keeping track of the current insertion point and the current buffer size, expanding the buffer when it fills, etc. Data buffers such as these are often used to assemble data that is to be transmitted over a communications link or written to a file. The use of these pre-designed buffers can increase the application programmer's productivity.

   However, if the data format contains embedded control fields and the data length is variable, then these pre-designed buffers cannot be used directly. Instead, the application programmer must necessarily provide code that handles the control fields and the context of variable-length records. For example, Figure 1 shows a file format that is more or less tabular, but each block or "row" is a different length and contains a length field and a checksum field. When reading the data, the application program must keep track of current location pointer within the current block, moving it past the length and checksum fields of the next block. When writing the data, the program must again keep track of the current location in order to start a new block if the maximum block length would be exceeded by the current "put" operation. The checksum must also be calculated on a write, and val...