create a new buffer chunk and adjust all pointers and indices . concode_field_sep long pointer concode_elem_sep int bufferListMaxIndex concode_elem_sep int CHUNK_SIZE concode_elem_sep long size concode_elem_sep byte[] currentBuffer concode_elem_sep List<byte[]> bufferList concode_elem_sep int bufferListIndex concode_elem_sep long currentBufferPointer concode_field_sep long getPosition concode_elem_sep int read concode_elem_sep int read concode_elem_sep void checkClosed concode_elem_sep boolean isClosed concode_elem_sep RandomAccessBuffer clone concode_elem_sep long length concode_elem_sep void close concode_elem_sep void seek concode_elem_sep void write concode_elem_sep void write concode_elem_sep void nextBuffer
void function ( ) { if ( bufferListMaxIndex > bufferListIndex ) { nextBuffer ( ) ; } else { currentBuffer = new byte [ CHUNK_SIZE ] ; bufferList . add ( currentBuffer ) ; currentBufferPointer = 0 ; bufferListMaxIndex ++ ; bufferListIndex ++ ; } }