Buffer Management and Positioning

Functions used to manipulate the buffer and the input and output positioning pointers.