\hypertarget{class_qore_1_1_stream_reader}{}\doxysection{Qore\+::Stream\+Reader Class Reference}
\label{class_qore_1_1_stream_reader}\index{Qore::StreamReader@{Qore::StreamReader}}


This class defines a stream reader for input streams.  




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



Inheritance diagram for Qore\+::Stream\+Reader\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=237pt]{class_qore_1_1_stream_reader__inherit__graph}
\end{center}
\end{figure}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{class_qore_1_1_stream_reader_a96d6c0a6aedba55c6d978d6ca25e905d}{constructor}} (\mbox{\hyperlink{class_qore_1_1_input_stream}{Qore\+::\+Input\+Stream}} is, \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} encoding)
\begin{DoxyCompactList}\small\item\em Creates the \mbox{\hyperlink{class_qore_1_1_stream_reader}{Stream\+Reader}} for reading data from the given \mbox{\hyperlink{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 \mbox{\hyperlink{character_encoding}{character encoding}} for the \mbox{\hyperlink{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 \mbox{\hyperlink{class_qore_1_1_input_stream}{Input\+Stream}} for the \mbox{\hyperlink{class_qore_1_1_stream_reader}{Stream\+Reader}}. \end{DoxyCompactList}\item 
\+\_\+\+\_\+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}} limit=-\/1)
\begin{DoxyCompactList}\small\item\em Reads binary data from the input stream up to a given limit. \end{DoxyCompactList}\item 
\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{class_qore_1_1_stream_reader_adea5382bcfda94ab3db34cacec0cc24e}{read\+Line}} (\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} eol, 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 
\+\_\+\+\_\+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}} 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 stream reader for input streams. 

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

\begin{DoxyCode}{0}
\DoxyCodeLine{FileInputStream is(\textcolor{stringliteral}{"{}data.txt"{}});}
\DoxyCodeLine{StreamReader 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}
\mbox{\hyperlink{class_qore_1_1_input_stream}{Qore\+::\+Input\+Stream}} 
\end{DoxySeeAlso}


\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{class_qore_1_1_stream_reader_a96d6c0a6aedba55c6d978d6ca25e905d}\label{class_qore_1_1_stream_reader_a96d6c0a6aedba55c6d978d6ca25e905d}} 
\index{Qore::StreamReader@{Qore::StreamReader}!constructor@{constructor}}
\index{constructor@{constructor}!Qore::StreamReader@{Qore::StreamReader}}
\doxysubsubsection{\texorpdfstring{constructor()}{constructor()}}
{\footnotesize\ttfamily Qore\+::\+Stream\+Reader\+::constructor (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{class_qore_1_1_input_stream}{Qore\+::\+Input\+Stream}}}]{is,  }\item[{\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{encoding }\end{DoxyParamCaption})}



Creates the \mbox{\hyperlink{class_qore_1_1_stream_reader}{Stream\+Reader}} for reading data from the given \mbox{\hyperlink{class_qore_1_1_input_stream}{Input\+Stream}}. 


\begin{DoxyParams}{Parameters}
{\em is} & the \mbox{\hyperlink{class_qore_1_1_input_stream}{Input\+Stream}} for reading data \\
\hline
{\em encoding} & character encoding of the data from the \mbox{\hyperlink{class_qore_1_1_input_stream}{Input\+Stream}}; if not present, the \mbox{\hyperlink{character_encoding_default_encoding}{default character encoding}} is assumed \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{class_qore_1_1_stream_reader_aec59d1b5a17bf3b3577f54447aebfc37}\label{class_qore_1_1_stream_reader_aec59d1b5a17bf3b3577f54447aebfc37}} 
\index{Qore::StreamReader@{Qore::StreamReader}!getEncoding@{getEncoding}}
\index{getEncoding@{getEncoding}!Qore::StreamReader@{Qore::StreamReader}}
\doxysubsubsection{\texorpdfstring{getEncoding()}{getEncoding()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+Stream\+Reader\+::get\+Encoding (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns the \mbox{\hyperlink{character_encoding}{character encoding}} for the \mbox{\hyperlink{class_qore_1_1_stream_reader}{Stream\+Reader}}. 

\begin{DoxyParagraph}{Code Flags\+:}
\mbox{\hyperlink{code_flags_CONSTANT}{CONSTANT}}
\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
the \mbox{\hyperlink{character_encoding}{character encoding}} for the \mbox{\hyperlink{class_qore_1_1_stream_reader}{Stream\+Reader}} 
\end{DoxyReturn}
\mbox{\Hypertarget{class_qore_1_1_stream_reader_aacf2ab395e40fcc8c05dfc42cc82c5f2}\label{class_qore_1_1_stream_reader_aacf2ab395e40fcc8c05dfc42cc82c5f2}} 
\index{Qore::StreamReader@{Qore::StreamReader}!getInputStream@{getInputStream}}
\index{getInputStream@{getInputStream}!Qore::StreamReader@{Qore::StreamReader}}
\doxysubsubsection{\texorpdfstring{getInputStream()}{getInputStream()}}
{\footnotesize\ttfamily \mbox{\hyperlink{class_qore_1_1_input_stream}{Input\+Stream}} Qore\+::\+Stream\+Reader\+::get\+Input\+Stream (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Returns the \mbox{\hyperlink{class_qore_1_1_input_stream}{Input\+Stream}} for the \mbox{\hyperlink{class_qore_1_1_stream_reader}{Stream\+Reader}}. 

Returns the \mbox{\hyperlink{class_qore_1_1_input_stream}{Input\+Stream}} for the \mbox{\hyperlink{class_qore_1_1_stream_reader}{Stream\+Reader}}.

\begin{DoxyReturn}{Returns}
the \mbox{\hyperlink{class_qore_1_1_input_stream}{Input\+Stream}} for the \mbox{\hyperlink{class_qore_1_1_stream_reader}{Stream\+Reader}}
\end{DoxyReturn}
\begin{DoxySince}{Since}
0.\+9.\+0 
\end{DoxySince}
\mbox{\Hypertarget{class_qore_1_1_stream_reader_af00e2052bdc6d41124ab809d37fd10b2}\label{class_qore_1_1_stream_reader_af00e2052bdc6d41124ab809d37fd10b2}} 
\index{Qore::StreamReader@{Qore::StreamReader}!readBinary@{readBinary}}
\index{readBinary@{readBinary}!Qore::StreamReader@{Qore::StreamReader}}
\doxysubsubsection{\texorpdfstring{readBinary()}{readBinary()}}
{\footnotesize\ttfamily \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}} Qore\+::\+Stream\+Reader\+::read\+Binary (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}}]{limit = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Reads binary data from the input stream up to a given limit. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{*binary b = sr.readBinary(16);}

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em limit} & maximum amount of binary data to read; if not given or equal to -\/1, all the data from the \mbox{\hyperlink{class_qore_1_1_input_stream}{Input\+Stream}} will be read; if equal to 0, \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} will be read\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a \mbox{\hyperlink{basic_data_types_binary}{Binary}} value or \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} if there is no more data available in the stream
\end{DoxyReturn}
\begin{DoxyNote}{Note}

\begin{DoxyItemize}
\item a short read (a binary object returned with fewer bytes than requested) indicates that there is no more data left in the stream
\item other stream read errors could be thrown here depending on the underlying \mbox{\hyperlink{class_qore_1_1_input_stream}{Input\+Stream}} implementation 
\end{DoxyItemize}
\end{DoxyNote}
\mbox{\Hypertarget{class_qore_1_1_stream_reader_a7beb4aa8e3c9a621e328cf21714bfc73}\label{class_qore_1_1_stream_reader_a7beb4aa8e3c9a621e328cf21714bfc73}} 
\index{Qore::StreamReader@{Qore::StreamReader}!readi1@{readi1}}
\index{readi1@{readi1}!Qore::StreamReader@{Qore::StreamReader}}
\doxysubsubsection{\texorpdfstring{readi1()}{readi1()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Stream\+Reader\+::readi1 (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Reads a 1-\/byte signed integer from the input stream. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{int i = sr.readi1();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
a 1-\/byte signed integer
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em END-\/\+OF-\/\+STREAM-\/\+ERROR} & there is not enough data available in the stream\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
other stream read errors could be thrown here depending on the underlying \mbox{\hyperlink{class_qore_1_1_input_stream}{Input\+Stream}} implementation 
\end{DoxyNote}
\mbox{\Hypertarget{class_qore_1_1_stream_reader_a9568ad9e4d1c61be1d8600adaa8a35d0}\label{class_qore_1_1_stream_reader_a9568ad9e4d1c61be1d8600adaa8a35d0}} 
\index{Qore::StreamReader@{Qore::StreamReader}!readi2@{readi2}}
\index{readi2@{readi2}!Qore::StreamReader@{Qore::StreamReader}}
\doxysubsubsection{\texorpdfstring{readi2()}{readi2()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Stream\+Reader\+::readi2 (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Reads a 2-\/byte (16 bit) signed integer from the input stream in binary big-\/endian format. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{int i = sr.readi2();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
a 2-\/byte signed integer
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em END-\/\+OF-\/\+STREAM-\/\+ERROR} & there is not enough data available in the stream\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
other stream read errors could be thrown here depending on the underlying \mbox{\hyperlink{class_qore_1_1_input_stream}{Input\+Stream}} implementation 
\end{DoxyNote}
\mbox{\Hypertarget{class_qore_1_1_stream_reader_a1eb80ee59c03ed0f2e033aa542daae3c}\label{class_qore_1_1_stream_reader_a1eb80ee59c03ed0f2e033aa542daae3c}} 
\index{Qore::StreamReader@{Qore::StreamReader}!readi2LSB@{readi2LSB}}
\index{readi2LSB@{readi2LSB}!Qore::StreamReader@{Qore::StreamReader}}
\doxysubsubsection{\texorpdfstring{readi2LSB()}{readi2LSB()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Stream\+Reader\+::readi2\+LSB (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Reads a 2-\/byte (16 bit) signed integer from the input stream in binary little-\/endian format. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{int i = sr.readi2LSB();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
a 2-\/byte signed integer
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em END-\/\+OF-\/\+STREAM-\/\+ERROR} & there is not enough data available in the stream\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
other stream read errors could be thrown here depending on the underlying \mbox{\hyperlink{class_qore_1_1_input_stream}{Input\+Stream}} implementation 
\end{DoxyNote}
\mbox{\Hypertarget{class_qore_1_1_stream_reader_a603106c0e5e36514aa069483fa670bc1}\label{class_qore_1_1_stream_reader_a603106c0e5e36514aa069483fa670bc1}} 
\index{Qore::StreamReader@{Qore::StreamReader}!readi4@{readi4}}
\index{readi4@{readi4}!Qore::StreamReader@{Qore::StreamReader}}
\doxysubsubsection{\texorpdfstring{readi4()}{readi4()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Stream\+Reader\+::readi4 (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Reads a 4-\/byte (32 bit) signed integer from the input stream in binary big-\/endian format. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{int i = sr.readi4();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
a 4-\/byte signed integer
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em END-\/\+OF-\/\+STREAM-\/\+ERROR} & there is not enough data available in the stream\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
other stream read errors could be thrown here depending on the underlying \mbox{\hyperlink{class_qore_1_1_input_stream}{Input\+Stream}} implementation 
\end{DoxyNote}
\mbox{\Hypertarget{class_qore_1_1_stream_reader_af42ede63f10857a250f081fab4b56ec2}\label{class_qore_1_1_stream_reader_af42ede63f10857a250f081fab4b56ec2}} 
\index{Qore::StreamReader@{Qore::StreamReader}!readi4LSB@{readi4LSB}}
\index{readi4LSB@{readi4LSB}!Qore::StreamReader@{Qore::StreamReader}}
\doxysubsubsection{\texorpdfstring{readi4LSB()}{readi4LSB()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Stream\+Reader\+::readi4\+LSB (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Reads a 4-\/byte (32 bit) signed integer from the input stream in binary little-\/endian format. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{int i = sr.readi4LSB();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
a 4-\/byte signed integer
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em END-\/\+OF-\/\+STREAM-\/\+ERROR} & there is not enough data available in the stream\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
other stream read errors could be thrown here depending on the underlying \mbox{\hyperlink{class_qore_1_1_input_stream}{Input\+Stream}} implementation 
\end{DoxyNote}
\mbox{\Hypertarget{class_qore_1_1_stream_reader_a8d20c8b5a2b9b6c4b56a853266d503d8}\label{class_qore_1_1_stream_reader_a8d20c8b5a2b9b6c4b56a853266d503d8}} 
\index{Qore::StreamReader@{Qore::StreamReader}!readi8@{readi8}}
\index{readi8@{readi8}!Qore::StreamReader@{Qore::StreamReader}}
\doxysubsubsection{\texorpdfstring{readi8()}{readi8()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Stream\+Reader\+::readi8 (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Reads a 8-\/byte (64 bit) signed integer from the input stream in binary big-\/endian format. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{int i = sr.readi8();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
a 8-\/byte signed integer
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em END-\/\+OF-\/\+STREAM-\/\+ERROR} & there is not enough data available in the stream\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
other stream read errors could be thrown here depending on the underlying \mbox{\hyperlink{class_qore_1_1_input_stream}{Input\+Stream}} implementation 
\end{DoxyNote}
\mbox{\Hypertarget{class_qore_1_1_stream_reader_a34b5fc4e002f417f03d54d163f966c82}\label{class_qore_1_1_stream_reader_a34b5fc4e002f417f03d54d163f966c82}} 
\index{Qore::StreamReader@{Qore::StreamReader}!readi8LSB@{readi8LSB}}
\index{readi8LSB@{readi8LSB}!Qore::StreamReader@{Qore::StreamReader}}
\doxysubsubsection{\texorpdfstring{readi8LSB()}{readi8LSB()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Stream\+Reader\+::readi8\+LSB (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Reads a 8-\/byte (64 bit) signed integer from the input stream in binary little-\/endian format. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{int i = sr.readi8LSB();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
a 8-\/byte signed integer
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em END-\/\+OF-\/\+STREAM-\/\+ERROR} & there is not enough data available in the stream\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
other stream read errors could be thrown here depending on the underlying \mbox{\hyperlink{class_qore_1_1_input_stream}{Input\+Stream}} implementation 
\end{DoxyNote}
\mbox{\Hypertarget{class_qore_1_1_stream_reader_adea5382bcfda94ab3db34cacec0cc24e}\label{class_qore_1_1_stream_reader_adea5382bcfda94ab3db34cacec0cc24e}} 
\index{Qore::StreamReader@{Qore::StreamReader}!readLine@{readLine}}
\index{readLine@{readLine}!Qore::StreamReader@{Qore::StreamReader}}
\doxysubsubsection{\texorpdfstring{readLine()}{readLine()}}
{\footnotesize\ttfamily \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+Stream\+Reader\+::read\+Line (\begin{DoxyParamCaption}\item[{\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{eol,  }\item[{bool}]{trim = {\ttfamily \mbox{\hyperlink{group__boolean__constants_ga3ba2df91713a6249449347131ea526c3}{True}}} }\end{DoxyParamCaption})}



Reads a text line from the input stream. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{string line = sr.readLine(\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em eol} & the optional end of line character(s) to use to detect lines in the data -\/ can be maximally 2 bytes long; if it is longer, the rest is ignored; if this string is not passed, then, if the character-\/encoding is ASCII-\/compatible, the end of line character(s) are detected automatically from {\ttfamily \char`\"{}\textbackslash{}n\char`\"{}}, {\ttfamily \char`\"{}\textbackslash{}r\char`\"{}}, or {\ttfamily \char`\"{}\textbackslash{}r\textbackslash{}n\char`\"{}}; if the stream uses a non-\/\+ASCII-\/compatible character encoding, then {\ttfamily \char`\"{}\textbackslash{}n\char`\"{}} is assumed \\
\hline
{\em trim} & if \mbox{\hyperlink{basic_data_types_True}{True}} the returned lines will be trimmed of the eol bytes\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a text line read from the stream or \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} if there is no more data available in the stream
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em ENCODING-\/\+CONVERSION-\/\+ERROR} & this exception could be thrown if the eol argument has a different \mbox{\hyperlink{character_encoding}{character encoding}} from the data\textquotesingle{}s and an error occurs during encoding conversion\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
other stream read errors could be thrown here depending on the underlying \mbox{\hyperlink{class_qore_1_1_input_stream}{Input\+Stream}} implementation 
\end{DoxyNote}
\mbox{\Hypertarget{class_qore_1_1_stream_reader_a39633f1ae94d010fb6e5628b0a950392}\label{class_qore_1_1_stream_reader_a39633f1ae94d010fb6e5628b0a950392}} 
\index{Qore::StreamReader@{Qore::StreamReader}!readString@{readString}}
\index{readString@{readString}!Qore::StreamReader@{Qore::StreamReader}}
\doxysubsubsection{\texorpdfstring{readString()}{readString()}}
{\footnotesize\ttfamily \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+Stream\+Reader\+::read\+String (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}}]{limit = {\ttfamily -\/1} }\end{DoxyParamCaption})}



Reads a string from the input stream. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{string str = sr.read(len);}

\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyParams}{Parameters}
{\em limit} & maximum amount of characters of string data to read; if not given or equal to -\/1, all the data from the \mbox{\hyperlink{class_qore_1_1_input_stream}{Input\+Stream}} will be read; if equal to 0, \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} will be read\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a \mbox{\hyperlink{basic_data_types_string}{String}} value or \mbox{\hyperlink{basic_data_types_nothing}{NOTHING}} if there is no more data available in the stream
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em STREAM-\/\+ENCODING-\/\+ERROR} & this exception is thrown if invalid character data is detected on the stream; this exception is not thrown when {\itshape limit} is negative, in such cases the input data is not verified\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}

\begin{DoxyItemize}
\item a short read (a string returned with fewer characters than requested) indicates that there is no more data left in the stream
\item other stream read errors could be thrown here depending on the underlying \mbox{\hyperlink{class_qore_1_1_input_stream}{Input\+Stream}} implementation 
\end{DoxyItemize}
\end{DoxyNote}
\mbox{\Hypertarget{class_qore_1_1_stream_reader_a9aaa92ffdf1a79b1220d58e03a55058a}\label{class_qore_1_1_stream_reader_a9aaa92ffdf1a79b1220d58e03a55058a}} 
\index{Qore::StreamReader@{Qore::StreamReader}!readu1@{readu1}}
\index{readu1@{readu1}!Qore::StreamReader@{Qore::StreamReader}}
\doxysubsubsection{\texorpdfstring{readu1()}{readu1()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Stream\+Reader\+::readu1 (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Reads a 1-\/byte unsigned integer from the input stream. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{int i = sr.readu1();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
a 1-\/byte unsigned integer
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em END-\/\+OF-\/\+STREAM-\/\+ERROR} & there is not enough data available in the stream\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
other stream read errors could be thrown here depending on the underlying \mbox{\hyperlink{class_qore_1_1_input_stream}{Input\+Stream}} implementation 
\end{DoxyNote}
\mbox{\Hypertarget{class_qore_1_1_stream_reader_ad6684d24897929ac9eaea32202adcce4}\label{class_qore_1_1_stream_reader_ad6684d24897929ac9eaea32202adcce4}} 
\index{Qore::StreamReader@{Qore::StreamReader}!readu2@{readu2}}
\index{readu2@{readu2}!Qore::StreamReader@{Qore::StreamReader}}
\doxysubsubsection{\texorpdfstring{readu2()}{readu2()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Stream\+Reader\+::readu2 (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Reads a 2-\/byte (16 bit) unsigned integer from the input stream in binary big-\/endian format. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{int i = sr.readu2();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
a 2-\/byte unsigned integer
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em END-\/\+OF-\/\+STREAM-\/\+ERROR} & there is not enough data available in the stream\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
other stream read errors could be thrown here depending on the underlying \mbox{\hyperlink{class_qore_1_1_input_stream}{Input\+Stream}} implementation 
\end{DoxyNote}
\mbox{\Hypertarget{class_qore_1_1_stream_reader_a51bece5c0164ba1f308efd86cb8d3d5d}\label{class_qore_1_1_stream_reader_a51bece5c0164ba1f308efd86cb8d3d5d}} 
\index{Qore::StreamReader@{Qore::StreamReader}!readu2LSB@{readu2LSB}}
\index{readu2LSB@{readu2LSB}!Qore::StreamReader@{Qore::StreamReader}}
\doxysubsubsection{\texorpdfstring{readu2LSB()}{readu2LSB()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Stream\+Reader\+::readu2\+LSB (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Reads a 2-\/byte (16 bit) unsigned integer from the input stream in binary little-\/endian format. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{int i = sr.readu2LSB();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
a 2-\/byte unsigned integer
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em END-\/\+OF-\/\+STREAM-\/\+ERROR} & there is not enough data available in the stream\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
other stream read errors could be thrown here depending on the underlying \mbox{\hyperlink{class_qore_1_1_input_stream}{Input\+Stream}} implementation 
\end{DoxyNote}
\mbox{\Hypertarget{class_qore_1_1_stream_reader_a027256490cc9e452117c28c30263acca}\label{class_qore_1_1_stream_reader_a027256490cc9e452117c28c30263acca}} 
\index{Qore::StreamReader@{Qore::StreamReader}!readu4@{readu4}}
\index{readu4@{readu4}!Qore::StreamReader@{Qore::StreamReader}}
\doxysubsubsection{\texorpdfstring{readu4()}{readu4()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Stream\+Reader\+::readu4 (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Reads a 4-\/byte (32 bit) unsigned integer from the input stream in binary big-\/endian format. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{int i = sr.readu4();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
a 4-\/byte unsigned integer
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em END-\/\+OF-\/\+STREAM-\/\+ERROR} & there is not enough data available in the stream\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
other stream read errors could be thrown here depending on the underlying \mbox{\hyperlink{class_qore_1_1_input_stream}{Input\+Stream}} implementation 
\end{DoxyNote}
\mbox{\Hypertarget{class_qore_1_1_stream_reader_a3c5861fb2dfcd92c4d307d44587736ba}\label{class_qore_1_1_stream_reader_a3c5861fb2dfcd92c4d307d44587736ba}} 
\index{Qore::StreamReader@{Qore::StreamReader}!readu4LSB@{readu4LSB}}
\index{readu4LSB@{readu4LSB}!Qore::StreamReader@{Qore::StreamReader}}
\doxysubsubsection{\texorpdfstring{readu4LSB()}{readu4LSB()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} Qore\+::\+Stream\+Reader\+::readu4\+LSB (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Reads a 4-\/byte (32 bit) unsigned integer from the input stream in binary little-\/endian format. 

\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{int i = sr.readu4LSB();}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
a 4-\/byte unsigned integer
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em END-\/\+OF-\/\+STREAM-\/\+ERROR} & there is not enough data available in the stream\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
other stream read errors could be thrown here depending on the underlying \mbox{\hyperlink{class_qore_1_1_input_stream}{Input\+Stream}} implementation 
\end{DoxyNote}
