.TH "zipios::BackBuffer" 3 "Tue May 9 2017" "Zipios++" \" -*- nroff -*- .ad l .nh .SH NAME zipios::BackBuffer \- A \fBBackBuffer\fP instance is useful for reading the last part of a file in an efficient manner, when it is not known exactly how far back (towards the front!) to go, to find the start of the desired data block\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits vector< unsigned char >\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBBackBuffer\fP (istream &is, \fBVirtualSeeker\fP vs=\fBVirtualSeeker\fP(), int chunk_size=1024)" .br .RI "\fBBackBuffer\fP constructor\&. " .ti -1c .RI "int \fBreadChunk\fP (int &read_pointer)" .br .RI "Reads another chunk and returns the size of the chunk that has been read\&. " .in -1c .SH "Detailed Description" .PP A \fBBackBuffer\fP instance is useful for reading the last part of a file in an efficient manner, when it is not known exactly how far back (towards the front!) to go, to find the start of the desired data block\&. \fBBackBuffer\fP is a vector< unsigned char > that fills itself with data from a file by reading chunks from the end of the file progressing towards the start\&. Upon construction the \fBBackBuffer\fP instance is associated with a file and a chunksize can be specified\&. To read a chunk of the file into the \fBBackBuffer\fP call \fBreadChunk()\fP\&. .PP Definition at line 32 of file backbuffer\&.h\&. .SH "Constructor & Destructor Documentation" .PP .SS "zipios::BackBuffer::BackBuffer (istream & is, \fBVirtualSeeker\fP vs = \fC\fBVirtualSeeker\fP()\fP, int chunk_size = \fC1024\fP)\fC [inline]\fP, \fC [explicit]\fP" .PP \fBBackBuffer\fP constructor\&. .PP \fBParameters:\fP .RS 4 \fIis\fP The istream to read the data from\&. The stream must be seekable, as \fBBackBuffer\fP will reposition the file position to read chunks from the back of the file\&. .br \fIchunk_size\fP specifies the size of the chunks to read the file into the \fBBackBuffer\fP in\&. .RE .PP \fBExceptions:\fP .RS 4 \fI\fBFCollException\fP\fP Thrown if the \fBVirtualSeeker\fP vs that has been specified is invalid for the istream is\&. .RE .PP .PP Definition at line 61 of file backbuffer\&.h\&. .SH "Member Function Documentation" .PP .SS "int zipios::BackBuffer::readChunk (int & read_pointer)\fC [inline]\fP" .PP Reads another chunk and returns the size of the chunk that has been read\&. Returns 0 on I/O failure\&. .PP \fBParameters:\fP .RS 4 \fIread_pointer\fP When a new chunk is read in the already stored bytes change position in the \fBBackBuffer\fP\&. read_pointer is assumed by \fBreadChunk()\fP to be a pointer into a position in the \fBBackBuffer\fP, and is updated to point to the same position in the file as it pointed to before the new chunk was read\&. .RE .PP .PP Definition at line 75 of file backbuffer\&.h\&. .SH "Author" .PP Generated automatically by Doxygen for Zipios++ from the source code\&.