[#BufferedFile]
= BufferedFile
:mrdocs:

Wrapper around an AutoFile&amp; that implements a ring buffer to deserialize from&period; It guarantees the ability to rewind a given number of bytes&period;

== Synopsis

Declared in `&lt;streams&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class BufferedFile;
----

== Description

Will automatically close the file when it goes out of scope if not null&period; If you need to close the file early, use file&period;fclose() instead of fclose(file)&period;

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BufferedFile/2constructor.adoc[`BufferedFile`]         [.small]#[constructor]#
| Wrap a source file with a ring buffer of nBufSize bytes, guaranteeing nRewindIn bytes of rewind&period;
| xref:BufferedFile/FindByte.adoc[`FindByte`] 
| search for a given byte in the stream, and remain positioned on it
| xref:BufferedFile/GetPos.adoc[`GetPos`] 
| return the current reading position
| xref:BufferedFile/SetLimit.adoc[`SetLimit`] 
| prevent reading beyond a certain position no argument removes the limit
| xref:BufferedFile/SetPos.adoc[`SetPos`] 
| rewind to a given reading position
| xref:BufferedFile/SkipTo.adoc[`SkipTo`] 
| Move the read position ahead in the stream to the given position&period; Use SetPos() to back up in the stream, not SkipTo()&period;
| xref:BufferedFile/eof.adoc[`eof`] 
| check whether we&apos;re at the end of the source file
| xref:BufferedFile/operator_rshift.adoc[`operator&gt;&gt;`] 
| Deserialize an object from the buffered file and return this wrapper&period;
| xref:BufferedFile/read.adoc[`read`] 
| read a number of bytes
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
