\hypertarget{classInputByteStream}{\section{Input\-Byte\-Stream Class Reference}
\label{classInputByteStream}\index{Input\-Byte\-Stream@{Input\-Byte\-Stream}}
}


Abstracts a file as a stream of bytes.  




{\ttfamily \#include $<$Input\-Byte\-Stream.\-h$>$}

Inheritance diagram for Input\-Byte\-Stream\-:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classInputByteStream}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classInputByteStream_a23cea9ff7fbdbdd866ed7db4cad62a1b}{Input\-Byte\-Stream} (int fileno)  throw (\-Input\-Byte\-Stream\-Error)
\begin{DoxyCompactList}\small\item\em Prepares to read a stream from the specified file descriptor, which must be open. \end{DoxyCompactList}\item 
\hyperlink{classInputByteStream_a72842f8f4ed32b81a7717d3d572bb6f8}{Input\-Byte\-Stream} (string srcspec)  throw (\-Input\-Byte\-Stream\-Error)
\begin{DoxyCompactList}\small\item\em Prepares to read a stream from the specified source. \end{DoxyCompactList}\item 
\hyperlink{classInputByteStream_aab7bb65a230ca42b962f3cd57f793474}{$\sim$\-Input\-Byte\-Stream} ()
\begin{DoxyCompactList}\small\item\em Closes the file and reclaims any buffers. \end{DoxyCompactList}\item 
bool \hyperlink{classInputByteStream_a16fca7b8f8bc2c56f91f2bce3145839c}{eof} ()
\begin{DoxyCompactList}\small\item\em Indicates whether we are at the end of the file. \end{DoxyCompactList}\item 
virtual void \hyperlink{classInputByteStream_a49494d95c8fb2c018330564ceeec6cc8}{close} ()
\begin{DoxyCompactList}\small\item\em Closes the stream, releasing all resources. \end{DoxyCompactList}\item 
\hyperlink{Byte_8h_ae3a497195d617519e5353ea7b417940f}{Byte} \hyperlink{classInputByteStream_a6c66e2167548d5e3ec8cbe8f9ab90279}{get\-Byte} (void)  throw (\-Input\-Byte\-Stream\-Error)
\begin{DoxyCompactList}\small\item\em Reads a byte from the stream. \end{DoxyCompactList}\item 
const \hyperlink{Byte_8h_ae3a497195d617519e5353ea7b417940f}{Byte} $\ast$ \hyperlink{classInputByteStream_a734737ee1f3ef659837e08f212ef1fb0}{get\-Block} (unsigned int length)  throw (\-Input\-Byte\-Stream\-Error)
\begin{DoxyCompactList}\small\item\em Retrieves a block from the current position in the stream. \end{DoxyCompactList}\item 
void \hyperlink{classInputByteStream_ac571d2d3c278d3c9b6f8a840cc2732e3}{skip} (unsigned int)  throw (\-Input\-Byte\-Stream\-Error)
\begin{DoxyCompactList}\small\item\em Skips a given number of bytes forward in the stream. \end{DoxyCompactList}\item 
signed int \hyperlink{classInputByteStream_a2f9916961a5092897cdb184ceed5b65a}{get\-S\-I\-U} (int)  throw (\-Input\-Byte\-Stream\-Error)
\begin{DoxyCompactList}\small\item\em Obtains an n-\/byte unsigned integer from the stream, as a signed int. \end{DoxyCompactList}\item 
signed int \hyperlink{classInputByteStream_afb8cbc5973fb31a37374a082b70570c7}{get\-S\-I\-S} (int)  throw (\-Input\-Byte\-Stream\-Error)
\begin{DoxyCompactList}\small\item\em Obtains an n-\/byte signed integer from the stream, as a signed int. \end{DoxyCompactList}\item 
unsigned int \hyperlink{classInputByteStream_a666f2d02dc840957d5830632ba0eeaf5}{get\-U\-I\-U} (int)  throw (\-Input\-Byte\-Stream\-Error)
\begin{DoxyCompactList}\small\item\em Obtains an n-\/byte unsigned integer from the stream, as an unsigned int. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static unsigned int \hyperlink{classInputByteStream_acbb0015b1ed37a07ea17187cc83facdc}{get\-U\-I\-U} (int, const \hyperlink{Byte_8h_ae3a497195d617519e5353ea7b417940f}{Byte} $\ast$)  throw (\-Input\-Byte\-Stream\-Error)
\begin{DoxyCompactList}\small\item\em Obtains an n-\/byte unsigned integer from the beginning of a {\ttfamily Byte} array, as an unsigned int. \end{DoxyCompactList}\item 
static void \hyperlink{classInputByteStream_aa8f6559507f4e269433f8bd1bf7887ec}{set\-Default\-Buffer\-Size} (unsigned int length)
\begin{DoxyCompactList}\small\item\em Sets the default buffer size to be used for reading files. \end{DoxyCompactList}\item 
static void \hyperlink{classInputByteStream_a3dec7c5a7e43a63edf30843f7ed63a40}{verbosity} (const \hyperlink{verbosity_8h_a886df075e73fd6d54e018791f87fa071}{verbosities} level)
\begin{DoxyCompactList}\small\item\em Sets the verbosity of this module. \end{DoxyCompactList}\item 
static \hyperlink{verbosity_8h_a886df075e73fd6d54e018791f87fa071}{verbosities} \hyperlink{classInputByteStream_a1f294ac769a4aa2869c4907fcf912462}{get\-Verbosity} (void)
\begin{DoxyCompactList}\small\item\em Returns the verbosity setting of this class. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classInputByteStream_a0216267e37288ad65483a6ebc3cfed7e}{Input\-Byte\-Stream} ()
\begin{DoxyCompactList}\small\item\em No-\/argument constructor creates a new \hyperlink{classInputByteStream}{Input\-Byte\-Stream} object, but does not associate it with any source of bytes. \end{DoxyCompactList}\item 
bool \hyperlink{classInputByteStream_a97ae3857b4a60e87f68c030497adaf04}{bind\-To\-File\-Descriptor} (int fileno, string filename=\char`\"{}\char`\"{}, int bufsize=0, bool fill\-Buffer\-And\-Close=false, bool assert\-Is\-Seekable=false)  throw (\-Input\-Byte\-Stream\-Error)
\begin{DoxyCompactList}\small\item\em Binds this stream to a given file descriptor. \end{DoxyCompactList}\item 
int \hyperlink{classInputByteStream_a42b74214719a29435ce2cb78c604b558}{open\-Source\-Spec} (string srcspec)  throw (\-Input\-Byte\-Stream\-Error)
\begin{DoxyCompactList}\small\item\em Opens a source. \end{DoxyCompactList}\item 
int \hyperlink{classInputByteStream_a0f58cb6d1dc1ab897febadd1ea5a90bc}{get\-F\-D} (void) const 
\begin{DoxyCompactList}\small\item\em Returns the file descriptor this stream is bound to. \end{DoxyCompactList}\item 
void \hyperlink{classInputByteStream_af9fdaaedb972b240dff6b5e4be4d9568}{buffer\-Seek} (unsigned int pos)  throw (\-Input\-Byte\-Stream\-Error)
\begin{DoxyCompactList}\small\item\em Seeks to a specific point in the buffer. \end{DoxyCompactList}\item 
void \hyperlink{classInputByteStream_a08566d67c9895845979bcd9e2ff4807f}{reload\-Buffer} (void)
\begin{DoxyCompactList}\small\item\em Reloads the buffer, presumably after the file descriptor has been adjusted by an extending class. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Abstracts a file as a stream of bytes. 

Functions are provided to read individual bytes from the file and blocks of contiguous bytes.

Since this class is intended to help reading Te\-X D\-V\-I and P\-K files, we also provide methods to read signed and unsigned integers from the stream, encoded as described in the D\-V\-I driver standard.

This class is designed to be extended (and is extended in fact in classes \hyperlink{classFileByteStream}{File\-Byte\-Stream} and \hyperlink{classPipeStream}{Pipe\-Stream}). The subclassing interface consists of a no-\/argument constructor, a method to associate the class with a given file descriptor (\hyperlink{classInputByteStream_a97ae3857b4a60e87f68c030497adaf04}{bind\-To\-File\-Descriptor}), and a convenience method to help opening files, using the same specification syntax supported by this class (\hyperlink{classInputByteStream_a42b74214719a29435ce2cb78c604b558}{open\-Source\-Spec}). Since one of the main purposes of this subclassing is to support a class which handles a seekable input stream, we also have \hyperlink{classInputByteStream_a0f58cb6d1dc1ab897febadd1ea5a90bc}{get\-F\-D} to get the file descriptor being handled, and \hyperlink{classInputByteStream_a08566d67c9895845979bcd9e2ff4807f}{reload\-Buffer} to indicate to the parent class that the underlying stream has been modified (typically by a {\ttfamily seek} operation) so that the input buffer should be invalidated. If {\ttfamily bind\-To\-File\-Descriptor} was invoked with the {\ttfamily fill\-Buffer\-And\-Close} flag true, then the \hyperlink{classInputByteStream_af9fdaaedb972b240dff6b5e4be4d9568}{buffer\-Seek} method allows rapid seeking by simply adjusting the buffer pointer; though this is useless unless the whole stream is in the buffer, the class makes no check on this, and it is the extending class's responsibility to make sure that this is not called inappropriately. 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classInputByteStream_a23cea9ff7fbdbdd866ed7db4cad62a1b}{\index{Input\-Byte\-Stream@{Input\-Byte\-Stream}!Input\-Byte\-Stream@{Input\-Byte\-Stream}}
\index{Input\-Byte\-Stream@{Input\-Byte\-Stream}!InputByteStream@{Input\-Byte\-Stream}}
\subsubsection[{Input\-Byte\-Stream}]{\setlength{\rightskip}{0pt plus 5cm}Input\-Byte\-Stream\-::\-Input\-Byte\-Stream (
\begin{DoxyParamCaption}
\item[{int}]{fd}
\end{DoxyParamCaption}
) throw  {\bf Input\-Byte\-Stream\-Error}) }}\label{classInputByteStream_a23cea9ff7fbdbdd866ed7db4cad62a1b}


Prepares to read a stream from the specified file descriptor, which must be open. 


\begin{DoxyParams}{Parameters}
{\em fd} & an open file descriptor \\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em \hyperlink{classInputByteStreamError}{Input\-Byte\-Stream\-Error}} & if there is a problem binding to the descriptor \\
\hline
\end{DoxyExceptions}
\hypertarget{classInputByteStream_a72842f8f4ed32b81a7717d3d572bb6f8}{\index{Input\-Byte\-Stream@{Input\-Byte\-Stream}!Input\-Byte\-Stream@{Input\-Byte\-Stream}}
\index{Input\-Byte\-Stream@{Input\-Byte\-Stream}!InputByteStream@{Input\-Byte\-Stream}}
\subsubsection[{Input\-Byte\-Stream}]{\setlength{\rightskip}{0pt plus 5cm}Input\-Byte\-Stream\-::\-Input\-Byte\-Stream (
\begin{DoxyParamCaption}
\item[{string}]{srcspec}
\end{DoxyParamCaption}
) throw  {\bf Input\-Byte\-Stream\-Error}) }}\label{classInputByteStream_a72842f8f4ed32b81a7717d3d572bb6f8}


Prepares to read a stream from the specified source. 

The source may be 
\begin{DoxyItemize}
\item a file name, which should be readable 
\item a specifier of the form {\ttfamily $<$osfile$>$filename}\-: the specified file is opened 
\item a specifier of the form {\ttfamily $<$osfd$>$integer}\-: the integer specifyies an (open) O\-S file descriptor; thus {\ttfamily $<$osfd$>$0} opens the standard input 
\end{DoxyItemize}


\begin{DoxyParams}{Parameters}
{\em srcspec} & a source specification as described above \\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em \hyperlink{classInputByteStreamError}{Input\-Byte\-Stream\-Error}} & if there is a problem opening or binding to the descriptor \\
\hline
\end{DoxyExceptions}
\hypertarget{classInputByteStream_aab7bb65a230ca42b962f3cd57f793474}{\index{Input\-Byte\-Stream@{Input\-Byte\-Stream}!$\sim$\-Input\-Byte\-Stream@{$\sim$\-Input\-Byte\-Stream}}
\index{$\sim$\-Input\-Byte\-Stream@{$\sim$\-Input\-Byte\-Stream}!InputByteStream@{Input\-Byte\-Stream}}
\subsubsection[{$\sim$\-Input\-Byte\-Stream}]{\setlength{\rightskip}{0pt plus 5cm}Input\-Byte\-Stream\-::$\sim$\-Input\-Byte\-Stream (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{classInputByteStream_aab7bb65a230ca42b962f3cd57f793474}


Closes the file and reclaims any buffers. 



References close().

\hypertarget{classInputByteStream_a0216267e37288ad65483a6ebc3cfed7e}{\index{Input\-Byte\-Stream@{Input\-Byte\-Stream}!Input\-Byte\-Stream@{Input\-Byte\-Stream}}
\index{Input\-Byte\-Stream@{Input\-Byte\-Stream}!InputByteStream@{Input\-Byte\-Stream}}
\subsubsection[{Input\-Byte\-Stream}]{\setlength{\rightskip}{0pt plus 5cm}Input\-Byte\-Stream\-::\-Input\-Byte\-Stream (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [protected]}}}\label{classInputByteStream_a0216267e37288ad65483a6ebc3cfed7e}


No-\/argument constructor creates a new \hyperlink{classInputByteStream}{Input\-Byte\-Stream} object, but does not associate it with any source of bytes. 

To associate it with a source, use \hyperlink{classInputByteStream_a97ae3857b4a60e87f68c030497adaf04}{bind\-To\-File\-Descriptor} or the convenience method \hyperlink{classInputByteStream_a42b74214719a29435ce2cb78c604b558}{open\-Source\-Spec}. 

\subsection{Member Function Documentation}
\hypertarget{classInputByteStream_a97ae3857b4a60e87f68c030497adaf04}{\index{Input\-Byte\-Stream@{Input\-Byte\-Stream}!bind\-To\-File\-Descriptor@{bind\-To\-File\-Descriptor}}
\index{bind\-To\-File\-Descriptor@{bind\-To\-File\-Descriptor}!InputByteStream@{Input\-Byte\-Stream}}
\subsubsection[{bind\-To\-File\-Descriptor}]{\setlength{\rightskip}{0pt plus 5cm}bool Input\-Byte\-Stream\-::bind\-To\-File\-Descriptor (
\begin{DoxyParamCaption}
\item[{int}]{fileno, }
\item[{string}]{filename = {\ttfamily \char`\"{}\char`\"{}}, }
\item[{int}]{bufsize = {\ttfamily 0}, }
\item[{bool}]{fill\-Buffer\-And\-Close = {\ttfamily false}, }
\item[{bool}]{assert\-Is\-Seekable = {\ttfamily false}}
\end{DoxyParamCaption}
) throw  {\bf Input\-Byte\-Stream\-Error}) \hspace{0.3cm}{\ttfamily [protected]}}}\label{classInputByteStream_a97ae3857b4a60e87f68c030497adaf04}


Binds this stream to a given file descriptor. 

If the parameter {\ttfamily fill\-Buffer\-And\-Close} is true, then this method will keep reading from the file descriptor until it reaches either the end of the newly-\/allocated buffer, or end-\/of-\/file, whichever comes first. It will then close the file descriptor. In this case (and in this case alone), the method \hyperlink{classInputByteStream_af9fdaaedb972b240dff6b5e4be4d9568}{buffer\-Seek} becomes useful, and can be used by an extending class to implement an efficient {\ttfamily seek} operation on the file.


\begin{DoxyParams}{Parameters}
{\em fileno} & the file descriptor to be handled by this object \\
\hline
{\em filename} & the file name associated with this descriptor; this may be the empty string \\
\hline
{\em bufsize} & a size suggested for the input buffer, or zero to accept the default \\
\hline
{\em fill\-Buffer\-And\-Close} & if true, read the entire contents of the file into memory \\
\hline
{\em assert\-Is\-Seekable} & if true, the caller is asserting that the given file descriptor points to a seekable object (presumably because it will depend on it being so). If this is not the case (the descriptor refers to a pipe or other non-\/seekable, and non-\/mappable, object), then throw an exception. If this is false, no assertion is being made; it is not being asserted that the object is non-\/seekable.\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em \hyperlink{classInputByteStreamError}{Input\-Byte\-Stream\-Error}} & if there is some other problem reading the file; or if a negative buffer size is given; or if the assertion described for parameter {\ttfamily assert\-Is\-Seekable} turns out to be false.\\
\hline
\end{DoxyExceptions}
\begin{DoxyReturn}{Returns}
true on success 
\end{DoxyReturn}


References debug, normal, and Util\-::verbosity\-\_\-.

\hypertarget{classInputByteStream_af9fdaaedb972b240dff6b5e4be4d9568}{\index{Input\-Byte\-Stream@{Input\-Byte\-Stream}!buffer\-Seek@{buffer\-Seek}}
\index{buffer\-Seek@{buffer\-Seek}!InputByteStream@{Input\-Byte\-Stream}}
\subsubsection[{buffer\-Seek}]{\setlength{\rightskip}{0pt plus 5cm}void Input\-Byte\-Stream\-::buffer\-Seek (
\begin{DoxyParamCaption}
\item[{unsigned int}]{offset}
\end{DoxyParamCaption}
) throw  {\bf Input\-Byte\-Stream\-Error}) \hspace{0.3cm}{\ttfamily [protected]}}}\label{classInputByteStream_af9fdaaedb972b240dff6b5e4be4d9568}


Seeks to a specific point in the buffer. 

This is only useful when the buffer holds the complete file, that is, when {\ttfamily bind\-To\-File\-Descriptor} was called with parameter {\ttfamily fill\-Buffer\-And\-Close} true.


\begin{DoxyParams}{Parameters}
{\em offset} & the offset from the beginning of the buffer, where the current position is relocated to\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em \hyperlink{classInputByteStreamError}{Input\-Byte\-Stream\-Error}} & if the offset would take the pointer outside the buffer, or if the stream has been closed \\
\hline
\end{DoxyExceptions}


References debug, and Util\-::verbosity\-\_\-.

\hypertarget{classInputByteStream_a49494d95c8fb2c018330564ceeec6cc8}{\index{Input\-Byte\-Stream@{Input\-Byte\-Stream}!close@{close}}
\index{close@{close}!InputByteStream@{Input\-Byte\-Stream}}
\subsubsection[{close}]{\setlength{\rightskip}{0pt plus 5cm}void Input\-Byte\-Stream\-::close (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}}\label{classInputByteStream_a49494d95c8fb2c018330564ceeec6cc8}


Closes the stream, releasing all resources. 



Reimplemented in \hyperlink{classPipeStream_ab059872aafd84de6aa9541224742bb93}{Pipe\-Stream}.



References normal, and Util\-::verbosity\-\_\-.



Referenced by Pipe\-Stream\-::close(), and $\sim$\-Input\-Byte\-Stream().

\hypertarget{classInputByteStream_a16fca7b8f8bc2c56f91f2bce3145839c}{\index{Input\-Byte\-Stream@{Input\-Byte\-Stream}!eof@{eof}}
\index{eof@{eof}!InputByteStream@{Input\-Byte\-Stream}}
\subsubsection[{eof}]{\setlength{\rightskip}{0pt plus 5cm}bool Input\-Byte\-Stream\-::eof (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{classInputByteStream_a16fca7b8f8bc2c56f91f2bce3145839c}


Indicates whether we are at the end of the file. 

This method does not return true until {\itshape after} a failed attempt to read past the end of file; that is, it does not return true immediately after the last byte has been read from the file.

\begin{DoxyReturn}{Returns}
true if we are at the end of the file 
\end{DoxyReturn}


Referenced by Dvi\-File\-::eof(), and get\-Byte().

\hypertarget{classInputByteStream_a734737ee1f3ef659837e08f212ef1fb0}{\index{Input\-Byte\-Stream@{Input\-Byte\-Stream}!get\-Block@{get\-Block}}
\index{get\-Block@{get\-Block}!InputByteStream@{Input\-Byte\-Stream}}
\subsubsection[{get\-Block}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf Byte} $\ast$ Input\-Byte\-Stream\-::get\-Block (
\begin{DoxyParamCaption}
\item[{unsigned int}]{length}
\end{DoxyParamCaption}
) throw  {\bf Input\-Byte\-Stream\-Error}) }}\label{classInputByteStream_a734737ee1f3ef659837e08f212ef1fb0}


Retrieves a block from the current position in the stream. 

Leaves the pointer pointing after the block returned.


\begin{DoxyParams}{Parameters}
{\em length} & the size of block desired\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a pointer to a block of bytes 
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em \hyperlink{classInputByteStreamError}{Input\-Byte\-Stream\-Error}} & if the requested number of bytes cannot be read, which includes the case of this method being called when {\ttfamily \hyperlink{classInputByteStream_a16fca7b8f8bc2c56f91f2bce3145839c}{eof()}} is true \\
\hline
\end{DoxyExceptions}
\hypertarget{classInputByteStream_a6c66e2167548d5e3ec8cbe8f9ab90279}{\index{Input\-Byte\-Stream@{Input\-Byte\-Stream}!get\-Byte@{get\-Byte}}
\index{get\-Byte@{get\-Byte}!InputByteStream@{Input\-Byte\-Stream}}
\subsubsection[{get\-Byte}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Byte} Input\-Byte\-Stream\-::get\-Byte (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
) throw  {\bf Input\-Byte\-Stream\-Error}) }}\label{classInputByteStream_a6c66e2167548d5e3ec8cbe8f9ab90279}


Reads a byte from the stream. 

Increments the reading pointer. This method does not signal an error at end-\/of-\/file; if \hyperlink{classInputByteStream_a16fca7b8f8bc2c56f91f2bce3145839c}{eof} is true or {\itshape becomes} true as a result of this attempt to read past the end of the file, then we return zero. That is, {\ttfamily \hyperlink{classInputByteStream_a16fca7b8f8bc2c56f91f2bce3145839c}{eof()}} does not return true immediately the last byte in the file has been read.

\begin{DoxyReturn}{Returns}
the byte read, or zero if we are at the end of the file 
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em \hyperlink{classInputByteStreamError}{Input\-Byte\-Stream\-Error}} & if there is some problem reading the stream \\
\hline
\end{DoxyExceptions}


References eof().

\hypertarget{classInputByteStream_a0f58cb6d1dc1ab897febadd1ea5a90bc}{\index{Input\-Byte\-Stream@{Input\-Byte\-Stream}!get\-F\-D@{get\-F\-D}}
\index{get\-F\-D@{get\-F\-D}!InputByteStream@{Input\-Byte\-Stream}}
\subsubsection[{get\-F\-D}]{\setlength{\rightskip}{0pt plus 5cm}int Input\-Byte\-Stream\-::get\-F\-D (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [protected]}}}\label{classInputByteStream_a0f58cb6d1dc1ab897febadd1ea5a90bc}


Returns the file descriptor this stream is bound to. 

If there is no open descriptor (see the {\ttfamily fill\-Buffer\-And\-Close} parameter to \hyperlink{classInputByteStream_a97ae3857b4a60e87f68c030497adaf04}{bind\-To\-File\-Descriptor}), returns negative.

\begin{DoxyReturn}{Returns}
the file descriptor, or negative if the descriptor has been closed 
\end{DoxyReturn}
\hypertarget{classInputByteStream_afb8cbc5973fb31a37374a082b70570c7}{\index{Input\-Byte\-Stream@{Input\-Byte\-Stream}!get\-S\-I\-S@{get\-S\-I\-S}}
\index{get\-S\-I\-S@{get\-S\-I\-S}!InputByteStream@{Input\-Byte\-Stream}}
\subsubsection[{get\-S\-I\-S}]{\setlength{\rightskip}{0pt plus 5cm}signed int Input\-Byte\-Stream\-::get\-S\-I\-S (
\begin{DoxyParamCaption}
\item[{int}]{n}
\end{DoxyParamCaption}
) throw  {\bf Input\-Byte\-Stream\-Error}) }}\label{classInputByteStream_afb8cbc5973fb31a37374a082b70570c7}


Obtains an n-\/byte signed integer from the stream, as a signed int. 


\begin{DoxyParams}{Parameters}
{\em n} & the number of bytes to read, in the range 1--4 inclusive \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the next integer from the input stream, as a signed int 
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em \hyperlink{classInputByteStreamError}{Input\-Byte\-Stream\-Error}} & if parameter {\ttfamily n} was out of range \\
\hline
\end{DoxyExceptions}
\hypertarget{classInputByteStream_a2f9916961a5092897cdb184ceed5b65a}{\index{Input\-Byte\-Stream@{Input\-Byte\-Stream}!get\-S\-I\-U@{get\-S\-I\-U}}
\index{get\-S\-I\-U@{get\-S\-I\-U}!InputByteStream@{Input\-Byte\-Stream}}
\subsubsection[{get\-S\-I\-U}]{\setlength{\rightskip}{0pt plus 5cm}signed int Input\-Byte\-Stream\-::get\-S\-I\-U (
\begin{DoxyParamCaption}
\item[{int}]{n}
\end{DoxyParamCaption}
) throw  {\bf Input\-Byte\-Stream\-Error}) }}\label{classInputByteStream_a2f9916961a5092897cdb184ceed5b65a}


Obtains an n-\/byte unsigned integer from the stream, as a signed int. 


\begin{DoxyParams}{Parameters}
{\em n} & the number of bytes to read, in the range 1--3 inclusive (there are no 4-\/byte unsigned quantities in D\-V\-I files) \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the next integer from the input stream, as a signed int 
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em \hyperlink{classInputByteStreamError}{Input\-Byte\-Stream\-Error}} & if parameter {\ttfamily n} was out of range \\
\hline
\end{DoxyExceptions}
\hypertarget{classInputByteStream_a666f2d02dc840957d5830632ba0eeaf5}{\index{Input\-Byte\-Stream@{Input\-Byte\-Stream}!get\-U\-I\-U@{get\-U\-I\-U}}
\index{get\-U\-I\-U@{get\-U\-I\-U}!InputByteStream@{Input\-Byte\-Stream}}
\subsubsection[{get\-U\-I\-U}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int Input\-Byte\-Stream\-::get\-U\-I\-U (
\begin{DoxyParamCaption}
\item[{int}]{n}
\end{DoxyParamCaption}
) throw  {\bf Input\-Byte\-Stream\-Error}) }}\label{classInputByteStream_a666f2d02dc840957d5830632ba0eeaf5}


Obtains an n-\/byte unsigned integer from the stream, as an unsigned int. 


\begin{DoxyParams}{Parameters}
{\em n} & the number of bytes to read, in the range 1--4 inclusive \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the next integer from the input stream, as an unsigned int 
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em \hyperlink{classInputByteStreamError}{Input\-Byte\-Stream\-Error}} & if parameter {\ttfamily n} was out of range \\
\hline
\end{DoxyExceptions}
\hypertarget{classInputByteStream_acbb0015b1ed37a07ea17187cc83facdc}{\index{Input\-Byte\-Stream@{Input\-Byte\-Stream}!get\-U\-I\-U@{get\-U\-I\-U}}
\index{get\-U\-I\-U@{get\-U\-I\-U}!InputByteStream@{Input\-Byte\-Stream}}
\subsubsection[{get\-U\-I\-U}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int Input\-Byte\-Stream\-::get\-U\-I\-U (
\begin{DoxyParamCaption}
\item[{int}]{n, }
\item[{const {\bf Byte} $\ast$}]{p}
\end{DoxyParamCaption}
) throw  {\bf Input\-Byte\-Stream\-Error}) \hspace{0.3cm}{\ttfamily [static]}}}\label{classInputByteStream_acbb0015b1ed37a07ea17187cc83facdc}


Obtains an n-\/byte unsigned integer from the beginning of a {\ttfamily Byte} array, as an unsigned int. 

This has little specifically to do with Input streams, and is here as a convenience method.


\begin{DoxyParams}{Parameters}
{\em n} & the number of bytes to read, in the range 1--4 inclusive \\
\hline
{\em p} & a pointer to an array of {\ttfamily Byte} values \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the integer at the beginning of the given array, as an unsigned int 
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em \hyperlink{classInputByteStreamError}{Input\-Byte\-Stream\-Error}} & if parameter {\ttfamily n} was out of range \\
\hline
\end{DoxyExceptions}
\hypertarget{classInputByteStream_a1f294ac769a4aa2869c4907fcf912462}{\index{Input\-Byte\-Stream@{Input\-Byte\-Stream}!get\-Verbosity@{get\-Verbosity}}
\index{get\-Verbosity@{get\-Verbosity}!InputByteStream@{Input\-Byte\-Stream}}
\subsubsection[{get\-Verbosity}]{\setlength{\rightskip}{0pt plus 5cm}static {\bf verbosities} Input\-Byte\-Stream\-::get\-Verbosity (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}}\label{classInputByteStream_a1f294ac769a4aa2869c4907fcf912462}


Returns the verbosity setting of this class. 



Referenced by Pipe\-Stream\-Signal\-Handling\-::expect\-Another(), and Pipe\-Stream\-Signal\-Handling\-::got\-\_\-status().

\hypertarget{classInputByteStream_a42b74214719a29435ce2cb78c604b558}{\index{Input\-Byte\-Stream@{Input\-Byte\-Stream}!open\-Source\-Spec@{open\-Source\-Spec}}
\index{open\-Source\-Spec@{open\-Source\-Spec}!InputByteStream@{Input\-Byte\-Stream}}
\subsubsection[{open\-Source\-Spec}]{\setlength{\rightskip}{0pt plus 5cm}int Input\-Byte\-Stream\-::open\-Source\-Spec (
\begin{DoxyParamCaption}
\item[{string}]{srcspec}
\end{DoxyParamCaption}
) throw  {\bf Input\-Byte\-Stream\-Error}) \hspace{0.3cm}{\ttfamily [protected]}}}\label{classInputByteStream_a42b74214719a29435ce2cb78c604b558}


Opens a source. 

The source is specified as in \hyperlink{classInputByteStream_a72842f8f4ed32b81a7717d3d572bb6f8}{Input\-Byte\-Stream(string)}. Throws an exception on any problems, so that if it returns, it has successfully opened the file, or determined that the file descriptor is (syntactically) valid.


\begin{DoxyParams}{Parameters}
{\em srcspec} & a source specification \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
an open file descriptor 
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em \hyperlink{classInputByteStreamError}{Input\-Byte\-Stream\-Error}} & if there is any problem opening the file \\
\hline
\end{DoxyExceptions}


References normal, and Util\-::verbosity\-\_\-.

\hypertarget{classInputByteStream_a08566d67c9895845979bcd9e2ff4807f}{\index{Input\-Byte\-Stream@{Input\-Byte\-Stream}!reload\-Buffer@{reload\-Buffer}}
\index{reload\-Buffer@{reload\-Buffer}!InputByteStream@{Input\-Byte\-Stream}}
\subsubsection[{reload\-Buffer}]{\setlength{\rightskip}{0pt plus 5cm}void Input\-Byte\-Stream\-::reload\-Buffer (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [protected]}}}\label{classInputByteStream_a08566d67c9895845979bcd9e2ff4807f}


Reloads the buffer, presumably after the file descriptor has been adjusted by an extending class. 



References debug, and Util\-::verbosity\-\_\-.

\hypertarget{classInputByteStream_aa8f6559507f4e269433f8bd1bf7887ec}{\index{Input\-Byte\-Stream@{Input\-Byte\-Stream}!set\-Default\-Buffer\-Size@{set\-Default\-Buffer\-Size}}
\index{set\-Default\-Buffer\-Size@{set\-Default\-Buffer\-Size}!InputByteStream@{Input\-Byte\-Stream}}
\subsubsection[{set\-Default\-Buffer\-Size}]{\setlength{\rightskip}{0pt plus 5cm}void Input\-Byte\-Stream\-::set\-Default\-Buffer\-Size (
\begin{DoxyParamCaption}
\item[{unsigned int}]{length}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}}\label{classInputByteStream_aa8f6559507f4e269433f8bd1bf7887ec}


Sets the default buffer size to be used for reading files. 


\begin{DoxyParams}{Parameters}
{\em length} & the size, in bytes, of the input buffer \\
\hline
\end{DoxyParams}
\hypertarget{classInputByteStream_ac571d2d3c278d3c9b6f8a840cc2732e3}{\index{Input\-Byte\-Stream@{Input\-Byte\-Stream}!skip@{skip}}
\index{skip@{skip}!InputByteStream@{Input\-Byte\-Stream}}
\subsubsection[{skip}]{\setlength{\rightskip}{0pt plus 5cm}void Input\-Byte\-Stream\-::skip (
\begin{DoxyParamCaption}
\item[{unsigned int}]{increment}
\end{DoxyParamCaption}
) throw  {\bf Input\-Byte\-Stream\-Error}) }}\label{classInputByteStream_ac571d2d3c278d3c9b6f8a840cc2732e3}


Skips a given number of bytes forward in the stream. 


\begin{DoxyParams}{Parameters}
{\em increment} & the number of bytes to move forward in the stream \\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em \hyperlink{classInputByteStreamError}{Input\-Byte\-Stream\-Error}} & if we skip past the end of file \\
\hline
\end{DoxyExceptions}
\hypertarget{classInputByteStream_a3dec7c5a7e43a63edf30843f7ed63a40}{\index{Input\-Byte\-Stream@{Input\-Byte\-Stream}!verbosity@{verbosity}}
\index{verbosity@{verbosity}!InputByteStream@{Input\-Byte\-Stream}}
\subsubsection[{verbosity}]{\setlength{\rightskip}{0pt plus 5cm}static void Input\-Byte\-Stream\-::verbosity (
\begin{DoxyParamCaption}
\item[{const {\bf verbosities}}]{level}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}}\label{classInputByteStream_a3dec7c5a7e43a63edf30843f7ed63a40}


Sets the verbosity of this module. 


\begin{DoxyParams}{Parameters}
{\em level} & the required verbosity \\
\hline
\end{DoxyParams}


Referenced by main().



The documentation for this class was generated from the following files\-:\begin{DoxyCompactItemize}
\item 
\hyperlink{InputByteStream_8h}{Input\-Byte\-Stream.\-h}\item 
\hyperlink{InputByteStream_8cc}{Input\-Byte\-Stream.\-cc}\end{DoxyCompactItemize}
