\doxysection{Qore\+::Buffered\+Stream\+Reader Class Reference}
\hypertarget{class_qore_1_1_buffered_stream_reader}{}\label{class_qore_1_1_buffered_stream_reader}\index{Qore::BufferedStreamReader@{Qore::BufferedStreamReader}}


This class defines a buffered stream reader for input streams.  




{\ttfamily \#include $<$QC\+\_\+\+Buffered\+Stream\+Reader.\+dox.\+h$>$}



Inheritance diagram for Qore\+::Buffered\+Stream\+Reader\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=237pt]{class_qore_1_1_buffered_stream_reader__inherit__graph}
\end{center}
\end{figure}
\doxysubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{class_qore_1_1_buffered_stream_reader_a064ea2a4b081059c812e735379477257}{constructor}} (\mbox{\hyperlink{class_qore_1_1_input_stream}{Qore\+::\+Input\+Stream}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{is}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} encoding, \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{bufsize}}=\mbox{\hyperlink{group___buffered_stream_reader_ga5a70489b1e5c32585eb23e2a4423c8f9}{Default\+Stream\+Buffer\+Size}})
\begin{DoxyCompactList}\small\item\em Creates the \doxylink{class_qore_1_1_buffered_stream_reader}{Buffered\+Stream\+Reader} for reading data from the given \doxylink{class_qore_1_1_input_stream}{Input\+Stream}. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions inherited from \mbox{\hyperlink{class_qore_1_1_stream_reader}{Qore\+::\+Stream\+Reader}}}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{class_qore_1_1_stream_reader_a96d6c0a6aedba55c6d978d6ca25e905d}{constructor}} (\mbox{\hyperlink{class_qore_1_1_input_stream}{Qore\+::\+Input\+Stream}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{is}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} encoding)
\begin{DoxyCompactList}\small\item\em Creates the \doxylink{class_qore_1_1_stream_reader}{Stream\+Reader} for reading data from the given \doxylink{class_qore_1_1_input_stream}{Input\+Stream}. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{class_qore_1_1_stream_reader_aec59d1b5a17bf3b3577f54447aebfc37}{get\+Encoding}} ()
\begin{DoxyCompactList}\small\item\em Returns the \doxylink{character_encoding}{character encoding} for the \doxylink{class_qore_1_1_stream_reader}{Stream\+Reader}. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_qore_1_1_input_stream}{Input\+Stream}} \mbox{\hyperlink{class_qore_1_1_stream_reader_aacf2ab395e40fcc8c05dfc42cc82c5f2}{get\+Input\+Stream}} ()
\begin{DoxyCompactList}\small\item\em Returns the \doxylink{class_qore_1_1_input_stream}{Input\+Stream} for the \doxylink{class_qore_1_1_stream_reader}{Stream\+Reader}. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}} \mbox{\hyperlink{class_qore_1_1_stream_reader_af00e2052bdc6d41124ab809d37fd10b2}{read\+Binary}} (\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{limit}}=-\/1)
\begin{DoxyCompactList}\small\item\em Reads binary data from the input stream up to a given limit. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{class_qore_1_1_stream_reader_adea5382bcfda94ab3db34cacec0cc24e}{read\+Line}} (\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{eol}}, \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{bool}} \mbox{\hyperlink{group__string__functions_gae8d314e819a299d46d181696600d4293}{trim}}=\mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}})
\begin{DoxyCompactList}\small\item\em Reads a text line from the input stream. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{class_qore_1_1_stream_reader_a39633f1ae94d010fb6e5628b0a950392}{read\+String}} (\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{limit}}=-\/1)
\begin{DoxyCompactList}\small\item\em Reads a string from the input stream. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_stream_reader_a7beb4aa8e3c9a621e328cf21714bfc73}{readi1}} ()
\begin{DoxyCompactList}\small\item\em Reads a 1-\/byte signed integer from the input stream. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_stream_reader_a9568ad9e4d1c61be1d8600adaa8a35d0}{readi2}} ()
\begin{DoxyCompactList}\small\item\em Reads a 2-\/byte (16 bit) signed integer from the input stream in binary big-\/endian format. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_stream_reader_a1eb80ee59c03ed0f2e033aa542daae3c}{readi2\+LSB}} ()
\begin{DoxyCompactList}\small\item\em Reads a 2-\/byte (16 bit) signed integer from the input stream in binary little-\/endian format. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_stream_reader_a603106c0e5e36514aa069483fa670bc1}{readi4}} ()
\begin{DoxyCompactList}\small\item\em Reads a 4-\/byte (32 bit) signed integer from the input stream in binary big-\/endian format. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_stream_reader_af42ede63f10857a250f081fab4b56ec2}{readi4\+LSB}} ()
\begin{DoxyCompactList}\small\item\em Reads a 4-\/byte (32 bit) signed integer from the input stream in binary little-\/endian format. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_stream_reader_a8d20c8b5a2b9b6c4b56a853266d503d8}{readi8}} ()
\begin{DoxyCompactList}\small\item\em Reads a 8-\/byte (64 bit) signed integer from the input stream in binary big-\/endian format. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_stream_reader_a34b5fc4e002f417f03d54d163f966c82}{readi8\+LSB}} ()
\begin{DoxyCompactList}\small\item\em Reads a 8-\/byte (64 bit) signed integer from the input stream in binary little-\/endian format. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_stream_reader_a9aaa92ffdf1a79b1220d58e03a55058a}{readu1}} ()
\begin{DoxyCompactList}\small\item\em Reads a 1-\/byte unsigned integer from the input stream. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_stream_reader_ad6684d24897929ac9eaea32202adcce4}{readu2}} ()
\begin{DoxyCompactList}\small\item\em Reads a 2-\/byte (16 bit) unsigned integer from the input stream in binary big-\/endian format. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_stream_reader_a51bece5c0164ba1f308efd86cb8d3d5d}{readu2\+LSB}} ()
\begin{DoxyCompactList}\small\item\em Reads a 2-\/byte (16 bit) unsigned integer from the input stream in binary little-\/endian format. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_stream_reader_a027256490cc9e452117c28c30263acca}{readu4}} ()
\begin{DoxyCompactList}\small\item\em Reads a 4-\/byte (32 bit) unsigned integer from the input stream in binary big-\/endian format. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} \mbox{\hyperlink{class_qore_1_1_stream_reader_a3c5861fb2dfcd92c4d307d44587736ba}{readu4\+LSB}} ()
\begin{DoxyCompactList}\small\item\em Reads a 4-\/byte (32 bit) unsigned integer from the input stream in binary little-\/endian format. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
This class defines a buffered stream reader for input streams. 

\begin{DoxySince}{Since}
Qore 0.\+8.\+13
\end{DoxySince}
\begin{DoxyParagraph}{Example\+: Buffered\+Stream\+Reader basic usage}

\begin{DoxyCode}{0}
\DoxyCodeLine{FileInputStream\ is(\textcolor{stringliteral}{"{}data.txt"{}});}
\DoxyCodeLine{BufferedStreamReader\ sr(\textcolor{keywordflow}{is},\ \textcolor{stringliteral}{"{}UTF-\/8"{}});}
\DoxyCodeLine{}
\DoxyCodeLine{*string\ line\ =\ sr.readLine();}
\DoxyCodeLine{*binary\ b\ =\ sr.readBinary(256);}
\DoxyCodeLine{int\ i\ =\ sr.readi4();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxySeeAlso}{See also}
\doxylink{class_qore_1_1_input_stream}{Qore\+::\+Input\+Stream} 
\end{DoxySeeAlso}


\doxysubsection{Member Function Documentation}
\Hypertarget{class_qore_1_1_buffered_stream_reader_a064ea2a4b081059c812e735379477257}\label{class_qore_1_1_buffered_stream_reader_a064ea2a4b081059c812e735379477257} 
\index{Qore::BufferedStreamReader@{Qore::BufferedStreamReader}!constructor@{constructor}}
\index{constructor@{constructor}!Qore::BufferedStreamReader@{Qore::BufferedStreamReader}}
\doxysubsubsection{\texorpdfstring{constructor()}{constructor()}}
{\footnotesize\ttfamily Qore\+::\+Buffered\+Stream\+Reader\+::constructor (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{class_qore_1_1_input_stream}{Qore\+::\+Input\+Stream}}}]{is,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga9a401e5112c58f63c05e7ee1e15968ef}{\+\_\+\+\_\+7\+\_\+}} \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{encoding,  }\item[{\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}}]{bufsize = {\ttfamily \mbox{\hyperlink{group___buffered_stream_reader_ga5a70489b1e5c32585eb23e2a4423c8f9}{Default\+Stream\+Buffer\+Size}}} }\end{DoxyParamCaption})}



Creates the \doxylink{class_qore_1_1_buffered_stream_reader}{Buffered\+Stream\+Reader} for reading data from the given \doxylink{class_qore_1_1_input_stream}{Input\+Stream}. 


\begin{DoxyParams}{Parameters}
{\em is} & the \doxylink{class_qore_1_1_input_stream}{Input\+Stream} for reading data \\
\hline
{\em encoding} & the character encoding of the data from the \doxylink{class_qore_1_1_input_stream}{Input\+Stream}; if not present, the \doxysectlink{character_encoding_default_encoding}{default character encoding}{1} is assumed \\
\hline
{\em bufsize} & the size of the internal buffer in bytes; must be a positive integer\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em STREAM-\/\+BUFFER-\/\+ERROR} & an invalid stream buffer size was specified; the buffer size must be a positive integer \\
\hline
\end{DoxyExceptions}
