<dd><ahref="../../System/IDisposable.html"title="interface in System">IDisposable</a></dd>
</dl>
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><ahref="../../Microsoft/Xna/Framework/Content/ContentReader.html"title="class in Microsoft.Xna.Framework.Content">ContentReader</a>, <ahref="../../Microsoft/Xna/Framework/Net/PacketReader.html"title="class in Microsoft.Xna.Framework.Net">PacketReader</a></dd>
</dl>
<hr>
<br>
<pre>public class <spanclass="strong">BinaryReader</span>
extends java.lang.Object
implements <ahref="../../System/IDisposable.html"title="interface in System">IDisposable</a></pre>
<divclass="block">Reads primitive data types as binary values in a specific encoding.</div>
<thclass="colOne"scope="col">Constructor and Description</th>
</tr>
<trclass="altColor">
<tdclass="colOne"><code><strong><ahref="../../System/IO/BinaryReader.html#BinaryReader(System.IO.Stream)">BinaryReader</a></strong>(<ahref="../../System/IO/Stream.html"title="class in System.IO">Stream</a> input)</code>
<divclass="block">Initializes a new instance of the BinaryReader class based on the supplied stream and using UTF-8 encoding.</div>
</td>
</tr>
<trclass="rowColor">
<tdclass="colOne"><code><strong><ahref="../../System/IO/BinaryReader.html#BinaryReader(System.IO.Stream, java.lang.String)">BinaryReader</a></strong>(<ahref="../../System/IO/Stream.html"title="class in System.IO">Stream</a> input,
java.lang.String encoding)</code>
<divclass="block">Initializes a new instance of the BinaryReader class based on the supplied stream and a specific character encoding.</div>
<divclass="block">Reads characters from the underlying stream and advances the current position of the stream in accordance with the Encoding used and the specific character being read from the stream.</div>
<pre>public BinaryReader(<ahref="../../System/IO/Stream.html"title="class in System.IO">Stream</a> input)</pre>
<divclass="block">Initializes a new instance of the BinaryReader class based on the supplied stream and using UTF-8 encoding.</div>
<dl><dt><spanclass="strong">Parameters:</span></dt><dd><code>input</code> - A stream.</dd>
<dt><spanclass="strong">Throws:</span></dt>
<dd><code><ahref="../../System/ArgumentException.html"title="class in System">ArgumentException</a></code> - The stream does not support reading, the stream is null, or the stream is already closed.</dd></dl>
<pre>public BinaryReader(<ahref="../../System/IO/Stream.html"title="class in System.IO">Stream</a> input,
java.lang.String encoding)</pre>
<divclass="block">Initializes a new instance of the BinaryReader class based on the supplied stream and a specific character encoding.</div>
<dl><dt><spanclass="strong">Parameters:</span></dt><dd><code>input</code> - The supplied stream.</dd><dd><code>encoding</code> - The character encoding.</dd>
<dt><spanclass="strong">Throws:</span></dt>
<dd><code><ahref="../../System/ArgumentNullException.html"title="class in System">ArgumentNullException</a></code> - input, or encoding is null.</dd>
<dd><code><ahref="../../System/ArgumentException.html"title="class in System">ArgumentException</a></code> - The stream does not support reading, or the stream is already closed.</dd></dl>
<pre>public <ahref="../../System/IO/Stream.html"title="class in System.IO">Stream</a> getBaseStream()</pre>
</li>
</ul>
<aname="Close()">
<!---->
</a>
<ulclass="blockList">
<liclass="blockList">
<h4>Close</h4>
<pre>public void Close()</pre>
<divclass="block">Closes the current reader and the underlying stream.</div>
</li>
</ul>
<aname="Dispose()">
<!---->
</a>
<ulclass="blockList">
<liclass="blockList">
<h4>Dispose</h4>
<pre>public void Dispose()</pre>
<divclass="block"><strong>Description copied from interface: <code><ahref="../../System/IDisposable.html#Dispose()">IDisposable</a></code></strong></div>
<divclass="block">Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><ahref="../../System/IDisposable.html#Dispose()">Dispose</a></code> in interface <code><ahref="../../System/IDisposable.html"title="interface in System">IDisposable</a></code></dd>
<divclass="block">Releases the unmanaged resources used by the BinaryReader and optionally releases the managed resources.</div>
<dl><dt><spanclass="strong">Parameters:</span></dt><dd><code>disposing</code> - true to release both managed and unmanaged resources; false to release only unmanaged resources.</dd></dl>
<divclass="block">Fills the internal buffer with the specified number of bytes read from the stream.</div>
<dl><dt><spanclass="strong">Parameters:</span></dt><dd><code>numBytes</code> - The number of bytes to be read.</dd>
<dt><spanclass="strong">Throws:</span></dt>
<dd><code><ahref="../../System/IO/EndOfStreamException.html"title="class in System.IO">EndOfStreamException</a></code> - The end of the stream is reached before numBytes could be read.</dd>
<dd><code><ahref="../../System/IO/IOException.html"title="class in System.IO">IOException</a></code> - An I/O error occurs.</dd>
<dd><code><ahref="../../System/ObjectDisposedException.html"title="class in System">ObjectDisposedException</a></code></dd></dl>
</li>
</ul>
<aname="Read()">
<!---->
</a>
<ulclass="blockList">
<liclass="blockList">
<h4>Read</h4>
<pre>public int Read()</pre>
<divclass="block">Reads characters from the underlying stream and advances the current position of the stream in accordance with the Encoding used and the specific character being read from the stream.</div>
<dl><dt><spanclass="strong">Returns:</span></dt><dd>The next character from the input stream, or -1 if no characters are currently available.</dd>
<dt><spanclass="strong">Throws:</span></dt>
<dd><code><ahref="../../System/ObjectDisposedException.html"title="class in System">ObjectDisposedException</a></code> - The stream is closed.</dd>
<dd><code><ahref="../../System/IO/IOException.html"title="class in System.IO">IOException</a></code> - An I/O error occurs.</dd></dl>
<divclass="block">Reads count bytes from the stream with index as the starting point in the byte array.</div>
<dl><dt><spanclass="strong">Parameters:</span></dt><dd><code>buffer</code> - The buffer to read data into.</dd><dd><code>index</code> - The starting point in the buffer at which to begin reading into the buffer.</dd><dd><code>count</code> - The number of characters to read.</dd>
<dt><spanclass="strong">Returns:</span></dt><dd>The number of characters read into buffer. This might be less than the number of bytes requested if that many bytes are not available, or it might be zero if the end of the stream is reached.</dd>
<dt><spanclass="strong">Throws:</span></dt>
<dd><code><ahref="../../System/ArgumentNullException.html"title="class in System">ArgumentNullException</a></code> - buffer is null.</dd>
<dd><code><ahref="../../System/ArgumentOutOfRangeException.html"title="class in System">ArgumentOutOfRangeException</a></code> - index or count is less than zero.</dd>
<dd><code><ahref="../../System/ArgumentException.html"title="class in System">ArgumentException</a></code> - The buffer length minus index is less than count.</dd>
<dd><code><ahref="../../System/ObjectDisposedException.html"title="class in System">ObjectDisposedException</a></code> - The stream is closed.</dd>
<dd><code><ahref="../../System/IO/IOException.html"title="class in System.IO">IOException</a></code> - An I/O error occurs.</dd></dl>
<divclass="block">Reads count characters from the stream with index as the starting point in the character array.</div>
<dl><dt><spanclass="strong">Parameters:</span></dt><dd><code>buffer</code> - The buffer to read data into.</dd><dd><code>index</code> - The starting point in the buffer at which to begin reading into the buffer.</dd><dd><code>count</code> - The number of characters to read.</dd>
<dt><spanclass="strong">Returns:</span></dt><dd>The total number of characters read into the buffer. This might be less than the number of characters
requested if that many characters are not currently available, or it might be zero if the end of the stream is reached.</dd>
<dt><spanclass="strong">Throws:</span></dt>
<dd><code><ahref="../../System/ArgumentException.html"title="class in System">ArgumentException</a></code> - The buffer length minus index is less than count.</dd>
<dd><code><ahref="../../System/ArgumentNullException.html"title="class in System">ArgumentNullException</a></code> - buffer is null.</dd>
<dd><code><ahref="../../System/ArgumentOutOfRangeException.html"title="class in System">ArgumentOutOfRangeException</a></code> - index or count is negative.</dd>
<dd><code><ahref="../../System/ObjectDisposedException.html"title="class in System">ObjectDisposedException</a></code> - The stream is closed.</dd>
<dd><code><ahref="../../System/IO/IOException.html"title="class in System.IO">IOException</a></code> - An I/O error occurs.</dd></dl>
<divclass="block">Reads a Boolean value from the current stream and advances the current position of the stream by one byte.</div>
<dl><dt><spanclass="strong">Returns:</span></dt><dd>true if the byte is nonzero; otherwise, false.</dd>
<dt><spanclass="strong">Throws:</span></dt>
<dd><code><ahref="../../System/ObjectDisposedException.html"title="class in System">ObjectDisposedException</a></code> - The stream is closed.</dd>
<dd><code><ahref="../../System/IO/IOException.html"title="class in System.IO">IOException</a></code> - An I/O error occurs.</dd>
<dd><code><ahref="../../System/IO/EndOfStreamException.html"title="class in System.IO">EndOfStreamException</a></code> - The end of the stream is reached.</dd></dl>
<divclass="block">Reads count bytes from the current stream into a byte array and advances the current position by count bytes.</div>
<dl><dt><spanclass="strong">Parameters:</span></dt><dd><code>count</code> - The number of bytes to read.</dd>
<dt><spanclass="strong">Returns:</span></dt><dd>A byte array containing data read from the underlying stream. This might be less than the number of bytes requested if the end of the stream is reached.</dd>
<dt><spanclass="strong">Throws:</span></dt>
<dd><code><ahref="../../System/ArgumentOutOfRangeException.html"title="class in System">ArgumentOutOfRangeException</a></code> - count is less than zero.</dd>
<dd><code><ahref="../../System/ObjectDisposedException.html"title="class in System">ObjectDisposedException</a></code> - The stream is closed.</dd>
<dd><code><ahref="../../System/IO/IOException.html"title="class in System.IO">IOException</a></code> - An I/O error occurs.</dd></dl>
<dd><code><ahref="../../System/ObjectDisposedException.html"title="class in System">ObjectDisposedException</a></code></dd>
<dd><code><ahref="../../System/ArgumentOutOfRangeException.html"title="class in System">ArgumentOutOfRangeException</a></code> - count is less than zero.</dd></dl>