934 lines
42 KiB
HTML
934 lines
42 KiB
HTML
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||
|
<!--NewPage-->
|
||
|
<HTML>
|
||
|
<HEAD>
|
||
|
<!-- Generated by javadoc (build 1.6.0_24) on Sun Apr 15 20:18:19 CEST 2012 -->
|
||
|
<TITLE>
|
||
|
MemoryStream
|
||
|
</TITLE>
|
||
|
|
||
|
<META NAME="date" CONTENT="2012-04-15">
|
||
|
|
||
|
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
|
||
|
|
||
|
<SCRIPT type="text/javascript">
|
||
|
function windowTitle()
|
||
|
{
|
||
|
if (location.href.indexOf('is-external=true') == -1) {
|
||
|
parent.document.title="MemoryStream";
|
||
|
}
|
||
|
}
|
||
|
</SCRIPT>
|
||
|
<NOSCRIPT>
|
||
|
</NOSCRIPT>
|
||
|
|
||
|
</HEAD>
|
||
|
|
||
|
<BODY BGCOLOR="white" onload="windowTitle();">
|
||
|
<HR>
|
||
|
|
||
|
|
||
|
<!-- ========= START OF TOP NAVBAR ======= -->
|
||
|
<A NAME="navbar_top"><!-- --></A>
|
||
|
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
|
||
|
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||
|
<TR>
|
||
|
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||
|
<A NAME="navbar_top_firstrow"><!-- --></A>
|
||
|
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||
|
<TR ALIGN="center" VALIGN="top">
|
||
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
|
||
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
||
|
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
|
||
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/MemoryStream.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
|
||
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
||
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
||
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
||
|
</TR>
|
||
|
</TABLE>
|
||
|
</TD>
|
||
|
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||
|
</EM>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
|
||
|
<TR>
|
||
|
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||
|
<A HREF="../../System/IO/IOException.html" title="class in System.IO"><B>PREV CLASS</B></A>
|
||
|
<A HREF="../../System/IO/PathTooLongException.html" title="class in System.IO"><B>NEXT CLASS</B></A></FONT></TD>
|
||
|
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||
|
<A HREF="../../index.html?System/IO/MemoryStream.html" target="_top"><B>FRAMES</B></A>
|
||
|
<A HREF="MemoryStream.html" target="_top"><B>NO FRAMES</B></A>
|
||
|
<SCRIPT type="text/javascript">
|
||
|
<!--
|
||
|
if(window==top) {
|
||
|
document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
|
||
|
}
|
||
|
//-->
|
||
|
</SCRIPT>
|
||
|
<NOSCRIPT>
|
||
|
<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
|
||
|
</NOSCRIPT>
|
||
|
|
||
|
|
||
|
</FONT></TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
||
|
SUMMARY: NESTED | <A HREF="#fields_inherited_from_class_System.IO.Stream">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
||
|
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
||
|
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
|
||
|
</TR>
|
||
|
</TABLE>
|
||
|
<A NAME="skip-navbar_top"></A>
|
||
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
||
|
|
||
|
<HR>
|
||
|
<!-- ======== START OF CLASS DATA ======== -->
|
||
|
<H2>
|
||
|
<FONT SIZE="-1">
|
||
|
System.IO</FONT>
|
||
|
<BR>
|
||
|
Class MemoryStream</H2>
|
||
|
<PRE>
|
||
|
java.lang.Object
|
||
|
<IMG SRC="../../resources/inherit.gif" ALT="extended by "><A HREF="../../System/IO/Stream.html" title="class in System.IO">System.IO.Stream</A>
|
||
|
<IMG SRC="../../resources/inherit.gif" ALT="extended by "><B>System.IO.MemoryStream</B>
|
||
|
</PRE>
|
||
|
<DL>
|
||
|
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../System/IDisposable.html" title="interface in System">IDisposable</A></DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
<DL>
|
||
|
<DT><PRE>public class <B>MemoryStream</B><DT>extends <A HREF="../../System/IO/Stream.html" title="class in System.IO">Stream</A></DL>
|
||
|
</PRE>
|
||
|
|
||
|
<P>
|
||
|
Defines a stream whose backing store is memory.
|
||
|
<P>
|
||
|
|
||
|
<P>
|
||
|
<DL>
|
||
|
<DT><B>Author:</B></DT>
|
||
|
<DD>Halofreak1990</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<P>
|
||
|
<!-- =========== FIELD SUMMARY =========== -->
|
||
|
|
||
|
<A NAME="field_summary"><!-- --></A>
|
||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||
|
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
||
|
<B>Field Summary</B></FONT></TH>
|
||
|
</TR>
|
||
|
</TABLE>
|
||
|
<A NAME="fields_inherited_from_class_System.IO.Stream"><!-- --></A>
|
||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||
|
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
|
||
|
<TH ALIGN="left"><B>Fields inherited from class System.IO.<A HREF="../../System/IO/Stream.html" title="class in System.IO">Stream</A></B></TH>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD><CODE><A HREF="../../System/IO/Stream.html#Null">Null</A></CODE></TD>
|
||
|
</TR>
|
||
|
</TABLE>
|
||
|
|
||
|
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
||
|
|
||
|
<A NAME="constructor_summary"><!-- --></A>
|
||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||
|
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
||
|
<B>Constructor Summary</B></FONT></TH>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD><CODE><B><A HREF="../../System/IO/MemoryStream.html#MemoryStream()">MemoryStream</A></B>()</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Initializes a new instance of the MemoryStream class with an expandable capacity initialized to zero.</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD><CODE><B><A HREF="../../System/IO/MemoryStream.html#MemoryStream(byte[])">MemoryStream</A></B>(byte[] buffer)</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Initializes a new non-resizable instance of the MemoryStream class based on the specified byte array.</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD><CODE><B><A HREF="../../System/IO/MemoryStream.html#MemoryStream(byte[], boolean)">MemoryStream</A></B>(byte[] buffer,
|
||
|
boolean writable)</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Initializes a new non-resizable instance of the MemoryStream class based on the specified byte array with the CanWrite property set as specified.</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD><CODE><B><A HREF="../../System/IO/MemoryStream.html#MemoryStream(byte[], int, int)">MemoryStream</A></B>(byte[] buffer,
|
||
|
int index,
|
||
|
int count)</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Initializes a new non-resizable instance of the MemoryStream class based on the specified region (index) of a byte array.</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD><CODE><B><A HREF="../../System/IO/MemoryStream.html#MemoryStream(byte[], int, int, boolean)">MemoryStream</A></B>(byte[] buffer,
|
||
|
int index,
|
||
|
int count,
|
||
|
boolean writable)</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Initializes a new non-resizable instance of the MemoryStream class based on the specified region of a byte array, with the CanWrite property set as specified.</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD><CODE><B><A HREF="../../System/IO/MemoryStream.html#MemoryStream(byte[], int, int, boolean, boolean)">MemoryStream</A></B>(byte[] buffer,
|
||
|
int index,
|
||
|
int count,
|
||
|
boolean writable,
|
||
|
boolean publiclyVisible)</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Initializes a new non-resizable instance of the MemoryStream class based on the specified region of a byte array, with the CanWrite property set as specified, and the ability to call GetBuffer set as specified.</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD><CODE><B><A HREF="../../System/IO/MemoryStream.html#MemoryStream(int)">MemoryStream</A></B>(int capacity)</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Initializes a new instance of the MemoryStream class with an expandable capacity initialized as specified.</TD>
|
||
|
</TR>
|
||
|
</TABLE>
|
||
|
|
||
|
<!-- ========== METHOD SUMMARY =========== -->
|
||
|
|
||
|
<A NAME="method_summary"><!-- --></A>
|
||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||
|
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
||
|
<B>Method Summary</B></FONT></TH>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||
|
<CODE> boolean</CODE></FONT></TD>
|
||
|
<TD><CODE><B><A HREF="../../System/IO/MemoryStream.html#CanRead()">CanRead</A></B>()</CODE>
|
||
|
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||
|
<CODE> boolean</CODE></FONT></TD>
|
||
|
<TD><CODE><B><A HREF="../../System/IO/MemoryStream.html#CanSeek()">CanSeek</A></B>()</CODE>
|
||
|
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||
|
<CODE> boolean</CODE></FONT></TD>
|
||
|
<TD><CODE><B><A HREF="../../System/IO/MemoryStream.html#CanWrite()">CanWrite</A></B>()</CODE>
|
||
|
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||
|
<CODE>protected void</CODE></FONT></TD>
|
||
|
<TD><CODE><B><A HREF="../../System/IO/MemoryStream.html#Dispose(boolean)">Dispose</A></B>(boolean disposing)</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Releases the unmanaged resources used by the MemoryStream and optionally releases the managed resources.</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||
|
<CODE> void</CODE></FONT></TD>
|
||
|
<TD><CODE><B><A HREF="../../System/IO/MemoryStream.html#Flush()">Flush</A></B>()</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Overrides Flush so that no action is performed.</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||
|
<CODE> byte[]</CODE></FONT></TD>
|
||
|
<TD><CODE><B><A HREF="../../System/IO/MemoryStream.html#GetBuffer()">GetBuffer</A></B>()</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Returns the array of unsigned bytes from which this stream was created.</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||
|
<CODE> int</CODE></FONT></TD>
|
||
|
<TD><CODE><B><A HREF="../../System/IO/MemoryStream.html#getCapacity()">getCapacity</A></B>()</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Gets the number of bytes allocated for this stream.</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||
|
<CODE> long</CODE></FONT></TD>
|
||
|
<TD><CODE><B><A HREF="../../System/IO/MemoryStream.html#getPosition()">getPosition</A></B>()</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Gets the current position within the stream.</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||
|
<CODE> long</CODE></FONT></TD>
|
||
|
<TD><CODE><B><A HREF="../../System/IO/MemoryStream.html#Length()">Length</A></B>()</CODE>
|
||
|
|
||
|
<BR>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||
|
<CODE> int</CODE></FONT></TD>
|
||
|
<TD><CODE><B><A HREF="../../System/IO/MemoryStream.html#Read(byte[], int, int)">Read</A></B>(byte[] buffer,
|
||
|
int offset,
|
||
|
int count)</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Reads a block of bytes from the current stream and writes the data to buffer.</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||
|
<CODE> int</CODE></FONT></TD>
|
||
|
<TD><CODE><B><A HREF="../../System/IO/MemoryStream.html#ReadByte()">ReadByte</A></B>()</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Reads a byte from the current stream.</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||
|
<CODE> long</CODE></FONT></TD>
|
||
|
<TD><CODE><B><A HREF="../../System/IO/MemoryStream.html#Seek(long, System.IO.SeekOrigin)">Seek</A></B>(long offset,
|
||
|
<A HREF="../../System/IO/SeekOrigin.html" title="enum in System.IO">SeekOrigin</A> origin)</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Sets the position within the current stream to the specified value.</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||
|
<CODE> void</CODE></FONT></TD>
|
||
|
<TD><CODE><B><A HREF="../../System/IO/MemoryStream.html#setCapacity(int)">setCapacity</A></B>(int value)</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Sets the number of bytes allocated for this stream.</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||
|
<CODE> void</CODE></FONT></TD>
|
||
|
<TD><CODE><B><A HREF="../../System/IO/MemoryStream.html#SetLength(long)">SetLength</A></B>(long value)</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Sets the length of the current stream to the specified value.</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||
|
<CODE> void</CODE></FONT></TD>
|
||
|
<TD><CODE><B><A HREF="../../System/IO/MemoryStream.html#setPosition(long)">setPosition</A></B>(long value)</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Sets the current position within the stream.</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||
|
<CODE> byte[]</CODE></FONT></TD>
|
||
|
<TD><CODE><B><A HREF="../../System/IO/MemoryStream.html#ToArray()">ToArray</A></B>()</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Writes the entire stream contents to a byte array, regardless of the Position property.</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||
|
<CODE> void</CODE></FONT></TD>
|
||
|
<TD><CODE><B><A HREF="../../System/IO/MemoryStream.html#Write(byte[], int, int)">Write</A></B>(byte[] buffer,
|
||
|
int offset,
|
||
|
int count)</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Writes a block of bytes to the current stream using data read from buffer.</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||
|
<CODE> void</CODE></FONT></TD>
|
||
|
<TD><CODE><B><A HREF="../../System/IO/MemoryStream.html#WriteByte(byte)">WriteByte</A></B>(byte value)</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Writes a byte to the current stream at the current position.</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||
|
<CODE> void</CODE></FONT></TD>
|
||
|
<TD><CODE><B><A HREF="../../System/IO/MemoryStream.html#WriteTo(java.io.OutputStream)">WriteTo</A></B>(java.io.OutputStream stream)</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Writes the entire contents of this memory stream to a java.io.OutputStream.</TD>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
||
|
<CODE> void</CODE></FONT></TD>
|
||
|
<TD><CODE><B><A HREF="../../System/IO/MemoryStream.html#WriteTo(System.IO.Stream)">WriteTo</A></B>(<A HREF="../../System/IO/Stream.html" title="class in System.IO">Stream</A> stream)</CODE>
|
||
|
|
||
|
<BR>
|
||
|
Writes the entire contents of this memory stream to another stream.</TD>
|
||
|
</TR>
|
||
|
</TABLE>
|
||
|
<A NAME="methods_inherited_from_class_System.IO.Stream"><!-- --></A>
|
||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||
|
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
|
||
|
<TH ALIGN="left"><B>Methods inherited from class System.IO.<A HREF="../../System/IO/Stream.html" title="class in System.IO">Stream</A></B></TH>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD><CODE><A HREF="../../System/IO/Stream.html#BeginRead(byte[], int, int, System.AsyncCallback, java.lang.Object)">BeginRead</A>, <A HREF="../../System/IO/Stream.html#BeginWrite(byte[], int, int, System.AsyncCallback, java.lang.Object)">BeginWrite</A>, <A HREF="../../System/IO/Stream.html#CanTimeout()">CanTimeout</A>, <A HREF="../../System/IO/Stream.html#Close()">Close</A>, <A HREF="../../System/IO/Stream.html#Dispose()">Dispose</A>, <A HREF="../../System/IO/Stream.html#EndRead(System.IAsyncResult)">EndRead</A>, <A HREF="../../System/IO/Stream.html#EndWrite(System.IAsyncResult)">EndWrite</A></CODE></TD>
|
||
|
</TR>
|
||
|
</TABLE>
|
||
|
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
|
||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||
|
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
|
||
|
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
|
||
|
</TR>
|
||
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
||
|
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
|
||
|
</TR>
|
||
|
</TABLE>
|
||
|
|
||
|
<P>
|
||
|
|
||
|
<!-- ========= CONSTRUCTOR DETAIL ======== -->
|
||
|
|
||
|
<A NAME="constructor_detail"><!-- --></A>
|
||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||
|
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
|
||
|
<B>Constructor Detail</B></FONT></TH>
|
||
|
</TR>
|
||
|
</TABLE>
|
||
|
|
||
|
<A NAME="MemoryStream()"><!-- --></A><H3>
|
||
|
MemoryStream</H3>
|
||
|
<PRE>
|
||
|
public <B>MemoryStream</B>()</PRE>
|
||
|
<DL>
|
||
|
<DD>Initializes a new instance of the MemoryStream class with an expandable capacity initialized to zero.
|
||
|
<P>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="MemoryStream(int)"><!-- --></A><H3>
|
||
|
MemoryStream</H3>
|
||
|
<PRE>
|
||
|
public <B>MemoryStream</B>(int capacity)</PRE>
|
||
|
<DL>
|
||
|
<DD>Initializes a new instance of the MemoryStream class with an expandable capacity initialized as specified.
|
||
|
<P>
|
||
|
<DL>
|
||
|
<DT><B>Parameters:</B><DD><CODE>capacity</CODE> - The initial size of the internal array in bytes.
|
||
|
<DT><B>Throws:</B>
|
||
|
<DD><CODE><A HREF="../../System/ArgumentOutOfRangeException.html" title="class in System">ArgumentOutOfRangeException</A></CODE> - capacity is negative.</DL>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="MemoryStream(byte[])"><!-- --></A><H3>
|
||
|
MemoryStream</H3>
|
||
|
<PRE>
|
||
|
public <B>MemoryStream</B>(byte[] buffer)</PRE>
|
||
|
<DL>
|
||
|
<DD>Initializes a new non-resizable instance of the MemoryStream class based on the specified byte array.
|
||
|
<P>
|
||
|
<DL>
|
||
|
<DT><B>Parameters:</B><DD><CODE>buffer</CODE> - The array of unsigned bytes from which to create the current stream.
|
||
|
<DT><B>Throws:</B>
|
||
|
<DD><CODE><A HREF="../../System/ArgumentNullException.html" title="class in System">ArgumentNullException</A></CODE> - buffer is null.</DL>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="MemoryStream(byte[], boolean)"><!-- --></A><H3>
|
||
|
MemoryStream</H3>
|
||
|
<PRE>
|
||
|
public <B>MemoryStream</B>(byte[] buffer,
|
||
|
boolean writable)</PRE>
|
||
|
<DL>
|
||
|
<DD>Initializes a new non-resizable instance of the MemoryStream class based on the specified byte array with the CanWrite property set as specified.
|
||
|
<P>
|
||
|
<DL>
|
||
|
<DT><B>Parameters:</B><DD><CODE>buffer</CODE> - The array of unsigned bytes from which to create this stream.<DD><CODE>writable</CODE> - The setting of the CanWrite property, which determines whether the stream supports writing.
|
||
|
<DT><B>Throws:</B>
|
||
|
<DD><CODE><A HREF="../../System/ArgumentNullException.html" title="class in System">ArgumentNullException</A></CODE> - buffer is null.</DL>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="MemoryStream(byte[], int, int)"><!-- --></A><H3>
|
||
|
MemoryStream</H3>
|
||
|
<PRE>
|
||
|
public <B>MemoryStream</B>(byte[] buffer,
|
||
|
int index,
|
||
|
int count)</PRE>
|
||
|
<DL>
|
||
|
<DD>Initializes a new non-resizable instance of the MemoryStream class based on the specified region (index) of a byte array.
|
||
|
<P>
|
||
|
<DL>
|
||
|
<DT><B>Parameters:</B><DD><CODE>buffer</CODE> - The array of unsigned bytes from which to create this stream.<DD><CODE>index</CODE> - The index into buffer at which the stream begins.<DD><CODE>count</CODE> - The length of the stream in bytes.
|
||
|
<DT><B>Throws:</B>
|
||
|
<DD><CODE><A HREF="../../System/ArgumentNullException.html" title="class in System">ArgumentNullException</A></CODE> - buffer is null.
|
||
|
<DD><CODE><A HREF="../../System/ArgumentOutOfRangeException.html" title="class in System">ArgumentOutOfRangeException</A></CODE> - index or count is less than zero.
|
||
|
<DD><CODE><A HREF="../../System/ArgumentException.html" title="class in System">ArgumentException</A></CODE> - The sum of index and count is greater than the length of buffer.</DL>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="MemoryStream(byte[], int, int, boolean)"><!-- --></A><H3>
|
||
|
MemoryStream</H3>
|
||
|
<PRE>
|
||
|
public <B>MemoryStream</B>(byte[] buffer,
|
||
|
int index,
|
||
|
int count,
|
||
|
boolean writable)</PRE>
|
||
|
<DL>
|
||
|
<DD>Initializes a new non-resizable instance of the MemoryStream class based on the specified region of a byte array, with the CanWrite property set as specified.
|
||
|
<P>
|
||
|
<DL>
|
||
|
<DT><B>Parameters:</B><DD><CODE>buffer</CODE> - The array of bytes from which to create this stream.<DD><CODE>index</CODE> - The index into buffer at which the stream begins.<DD><CODE>count</CODE> - The length of the stream in bytes.<DD><CODE>writable</CODE> - The setting of the CanWrite property, which determines whether the stream supports writing.
|
||
|
<DT><B>Throws:</B>
|
||
|
<DD><CODE><A HREF="../../System/ArgumentNullException.html" title="class in System">ArgumentNullException</A></CODE> - buffer is null.
|
||
|
<DD><CODE><A HREF="../../System/ArgumentOutOfRangeException.html" title="class in System">ArgumentOutOfRangeException</A></CODE> - index or count is less than zero.
|
||
|
<DD><CODE><A HREF="../../System/ArgumentException.html" title="class in System">ArgumentException</A></CODE> - The sum of index and count is greater than the length of buffer.</DL>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="MemoryStream(byte[], int, int, boolean, boolean)"><!-- --></A><H3>
|
||
|
MemoryStream</H3>
|
||
|
<PRE>
|
||
|
public <B>MemoryStream</B>(byte[] buffer,
|
||
|
int index,
|
||
|
int count,
|
||
|
boolean writable,
|
||
|
boolean publiclyVisible)</PRE>
|
||
|
<DL>
|
||
|
<DD>Initializes a new non-resizable instance of the MemoryStream class based on the specified region of a byte array, with the CanWrite property set as specified, and the ability to call GetBuffer set as specified.
|
||
|
<P>
|
||
|
<DL>
|
||
|
<DT><B>Parameters:</B><DD><CODE>buffer</CODE> - The array of bytes from which to create this stream.<DD><CODE>index</CODE> - The index into buffer at which the stream begins.<DD><CODE>count</CODE> - The length of the stream in bytes.<DD><CODE>writable</CODE> - The setting of the CanWrite property, which determines whether the stream supports writing.<DD><CODE>publiclyVisible</CODE> - true to enable GetBuffer, which returns the byte array from which the stream was created; otherwise, false.
|
||
|
<DT><B>Throws:</B>
|
||
|
<DD><CODE><A HREF="../../System/ArgumentNullException.html" title="class in System">ArgumentNullException</A></CODE> - buffer is null.
|
||
|
<DD><CODE><A HREF="../../System/ArgumentOutOfRangeException.html" title="class in System">ArgumentOutOfRangeException</A></CODE> - index or count is less than zero.
|
||
|
<DD><CODE><A HREF="../../System/ArgumentException.html" title="class in System">ArgumentException</A></CODE> - The sum of index and count is greater than the length of buffer.</DL>
|
||
|
</DL>
|
||
|
|
||
|
<!-- ============ METHOD DETAIL ========== -->
|
||
|
|
||
|
<A NAME="method_detail"><!-- --></A>
|
||
|
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||
|
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||
|
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
|
||
|
<B>Method Detail</B></FONT></TH>
|
||
|
</TR>
|
||
|
</TABLE>
|
||
|
|
||
|
<A NAME="CanRead()"><!-- --></A><H3>
|
||
|
CanRead</H3>
|
||
|
<PRE>
|
||
|
public boolean <B>CanRead</B>()</PRE>
|
||
|
<DL>
|
||
|
<DD><DL>
|
||
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../System/IO/Stream.html#CanRead()">CanRead</A></CODE> in class <CODE><A HREF="../../System/IO/Stream.html" title="class in System.IO">Stream</A></CODE></DL>
|
||
|
</DD>
|
||
|
<DD><DL>
|
||
|
</DL>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="CanSeek()"><!-- --></A><H3>
|
||
|
CanSeek</H3>
|
||
|
<PRE>
|
||
|
public boolean <B>CanSeek</B>()</PRE>
|
||
|
<DL>
|
||
|
<DD><DL>
|
||
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../System/IO/Stream.html#CanSeek()">CanSeek</A></CODE> in class <CODE><A HREF="../../System/IO/Stream.html" title="class in System.IO">Stream</A></CODE></DL>
|
||
|
</DD>
|
||
|
<DD><DL>
|
||
|
</DL>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="CanWrite()"><!-- --></A><H3>
|
||
|
CanWrite</H3>
|
||
|
<PRE>
|
||
|
public boolean <B>CanWrite</B>()</PRE>
|
||
|
<DL>
|
||
|
<DD><DL>
|
||
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../System/IO/Stream.html#CanWrite()">CanWrite</A></CODE> in class <CODE><A HREF="../../System/IO/Stream.html" title="class in System.IO">Stream</A></CODE></DL>
|
||
|
</DD>
|
||
|
<DD><DL>
|
||
|
</DL>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="getCapacity()"><!-- --></A><H3>
|
||
|
getCapacity</H3>
|
||
|
<PRE>
|
||
|
public int <B>getCapacity</B>()</PRE>
|
||
|
<DL>
|
||
|
<DD>Gets the number of bytes allocated for this stream.
|
||
|
<P>
|
||
|
<DD><DL>
|
||
|
|
||
|
<DT><B>Returns:</B><DD>The length of the usable portion of the buffer for the stream.
|
||
|
<DT><B>Throws:</B>
|
||
|
<DD><CODE><A HREF="../../System/ObjectDisposedException.html" title="class in System">ObjectDisposedException</A></CODE> - The current stream is closed.</DL>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="setCapacity(int)"><!-- --></A><H3>
|
||
|
setCapacity</H3>
|
||
|
<PRE>
|
||
|
public void <B>setCapacity</B>(int value)</PRE>
|
||
|
<DL>
|
||
|
<DD>Sets the number of bytes allocated for this stream.
|
||
|
<P>
|
||
|
<DD><DL>
|
||
|
|
||
|
<DT><B>Throws:</B>
|
||
|
<DD><CODE><A HREF="../../System/ArgumentOutOfRangeException.html" title="class in System">ArgumentOutOfRangeException</A></CODE> - A capacity is set that is negative or less than the current length of the stream.
|
||
|
<DD><CODE><A HREF="../../System/ObjectDisposedException.html" title="class in System">ObjectDisposedException</A></CODE> - The current stream is closed.
|
||
|
<DD><CODE><A HREF="../../System/NotSupportedException.html" title="class in System">NotSupportedException</A></CODE> - set is invoked on a stream whose capacity cannot be modified.</DL>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="Length()"><!-- --></A><H3>
|
||
|
Length</H3>
|
||
|
<PRE>
|
||
|
public long <B>Length</B>()</PRE>
|
||
|
<DL>
|
||
|
<DD><DL>
|
||
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../System/IO/Stream.html#Length()">Length</A></CODE> in class <CODE><A HREF="../../System/IO/Stream.html" title="class in System.IO">Stream</A></CODE></DL>
|
||
|
</DD>
|
||
|
<DD><DL>
|
||
|
</DL>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="getPosition()"><!-- --></A><H3>
|
||
|
getPosition</H3>
|
||
|
<PRE>
|
||
|
public long <B>getPosition</B>()</PRE>
|
||
|
<DL>
|
||
|
<DD>Gets the current position within the stream.
|
||
|
<P>
|
||
|
<DD><DL>
|
||
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../System/IO/Stream.html#getPosition()">getPosition</A></CODE> in class <CODE><A HREF="../../System/IO/Stream.html" title="class in System.IO">Stream</A></CODE></DL>
|
||
|
</DD>
|
||
|
<DD><DL>
|
||
|
|
||
|
<DT><B>Returns:</B><DD>The current position within the stream.
|
||
|
<DT><B>Throws:</B>
|
||
|
<DD><CODE><A HREF="../../System/ObjectDisposedException.html" title="class in System">ObjectDisposedException</A></CODE> - The stream is closed.</DL>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="setPosition(long)"><!-- --></A><H3>
|
||
|
setPosition</H3>
|
||
|
<PRE>
|
||
|
public void <B>setPosition</B>(long value)</PRE>
|
||
|
<DL>
|
||
|
<DD>Sets the current position within the stream.
|
||
|
<P>
|
||
|
<DD><DL>
|
||
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../System/IO/Stream.html#setPosition(long)">setPosition</A></CODE> in class <CODE><A HREF="../../System/IO/Stream.html" title="class in System.IO">Stream</A></CODE></DL>
|
||
|
</DD>
|
||
|
<DD><DL>
|
||
|
|
||
|
<DT><B>Throws:</B>
|
||
|
<DD><CODE><A HREF="../../System/ObjectDisposedException.html" title="class in System">ObjectDisposedException</A></CODE> - The stream is closed.
|
||
|
<DD><CODE><A HREF="../../System/ArgumentOutOfRangeException.html" title="class in System">ArgumentOutOfRangeException</A></CODE> - The position is set to a negative value or a value greater than MaxValue.</DL>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="Dispose(boolean)"><!-- --></A><H3>
|
||
|
Dispose</H3>
|
||
|
<PRE>
|
||
|
protected void <B>Dispose</B>(boolean disposing)</PRE>
|
||
|
<DL>
|
||
|
<DD>Releases the unmanaged resources used by the MemoryStream and optionally releases the managed resources.
|
||
|
<P>
|
||
|
<DD><DL>
|
||
|
<DT><B>Overrides:</B><DD><CODE><A HREF="../../System/IO/Stream.html#Dispose(boolean)">Dispose</A></CODE> in class <CODE><A HREF="../../System/IO/Stream.html" title="class in System.IO">Stream</A></CODE></DL>
|
||
|
</DD>
|
||
|
<DD><DL>
|
||
|
<DT><B>Parameters:</B><DD><CODE>disposing</CODE> - true to release both managed and unmanaged resources; false to release only unmanaged resources.</DL>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="Flush()"><!-- --></A><H3>
|
||
|
Flush</H3>
|
||
|
<PRE>
|
||
|
public void <B>Flush</B>()</PRE>
|
||
|
<DL>
|
||
|
<DD>Overrides Flush so that no action is performed.
|
||
|
<P>
|
||
|
<DD><DL>
|
||
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../System/IO/Stream.html#Flush()">Flush</A></CODE> in class <CODE><A HREF="../../System/IO/Stream.html" title="class in System.IO">Stream</A></CODE></DL>
|
||
|
</DD>
|
||
|
<DD><DL>
|
||
|
</DL>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="GetBuffer()"><!-- --></A><H3>
|
||
|
GetBuffer</H3>
|
||
|
<PRE>
|
||
|
public byte[] <B>GetBuffer</B>()</PRE>
|
||
|
<DL>
|
||
|
<DD>Returns the array of unsigned bytes from which this stream was created.
|
||
|
<P>
|
||
|
<DD><DL>
|
||
|
|
||
|
<DT><B>Returns:</B><DD>The byte array from which this stream was created, or the underlying array if a byte array was not provided to the MemoryStream constructor during construction of the current instance.
|
||
|
<DT><B>Throws:</B>
|
||
|
<DD><CODE><A HREF="../../System/UnauthorizedAccessException.html" title="class in System">UnauthorizedAccessException</A></CODE> - The MemoryStream instance was not created with a publicly visible buffer.</DL>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="ReadByte()"><!-- --></A><H3>
|
||
|
ReadByte</H3>
|
||
|
<PRE>
|
||
|
public int <B>ReadByte</B>()</PRE>
|
||
|
<DL>
|
||
|
<DD>Reads a byte from the current stream.
|
||
|
<P>
|
||
|
<DD><DL>
|
||
|
<DT><B>Overrides:</B><DD><CODE><A HREF="../../System/IO/Stream.html#ReadByte()">ReadByte</A></CODE> in class <CODE><A HREF="../../System/IO/Stream.html" title="class in System.IO">Stream</A></CODE></DL>
|
||
|
</DD>
|
||
|
<DD><DL>
|
||
|
|
||
|
<DT><B>Returns:</B><DD>The byte cast to a Int32, or -1 if the end of the stream has been reached.
|
||
|
<DT><B>Throws:</B>
|
||
|
<DD><CODE><A HREF="../../System/ObjectDisposedException.html" title="class in System">ObjectDisposedException</A></CODE> - The current stream instance is closed.</DL>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="Read(byte[], int, int)"><!-- --></A><H3>
|
||
|
Read</H3>
|
||
|
<PRE>
|
||
|
public int <B>Read</B>(byte[] buffer,
|
||
|
int offset,
|
||
|
int count)</PRE>
|
||
|
<DL>
|
||
|
<DD>Reads a block of bytes from the current stream and writes the data to buffer.
|
||
|
<P>
|
||
|
<DD><DL>
|
||
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../System/IO/Stream.html#Read(byte[], int, int)">Read</A></CODE> in class <CODE><A HREF="../../System/IO/Stream.html" title="class in System.IO">Stream</A></CODE></DL>
|
||
|
</DD>
|
||
|
<DD><DL>
|
||
|
<DT><B>Parameters:</B><DD><CODE>buffer</CODE> - When this method returns, contains the specified byte array with the values between offset and (offset + count - 1) replaced by the characters read from the current stream.<DD><CODE>offset</CODE> - The byte offset in buffer at which to begin reading.<DD><CODE>count</CODE> - The maximum number of bytes to read.
|
||
|
<DT><B>Returns:</B><DD>The total number of bytes written into the buffer. This can be less than the number of bytes requested if that number of bytes are not currently available, or zero if the end of the stream is reached before any bytes are read.
|
||
|
<DT><B>Throws:</B>
|
||
|
<DD><CODE><A HREF="../../System/ObjectDisposedException.html" title="class in System">ObjectDisposedException</A></CODE> - The current stream instance is closed.
|
||
|
<DD><CODE><A HREF="../../System/ArgumentNullException.html" title="class in System">ArgumentNullException</A></CODE> - buffer is null.
|
||
|
<DD><CODE><A HREF="../../System/ArgumentOutOfRangeException.html" title="class in System">ArgumentOutOfRangeException</A></CODE> - offset or count is negative.
|
||
|
<DD><CODE><A HREF="../../System/ArgumentException.html" title="class in System">ArgumentException</A></CODE> - offset subtracted from the buffer length is less than count.</DL>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="Seek(long, System.IO.SeekOrigin)"><!-- --></A><H3>
|
||
|
Seek</H3>
|
||
|
<PRE>
|
||
|
public long <B>Seek</B>(long offset,
|
||
|
<A HREF="../../System/IO/SeekOrigin.html" title="enum in System.IO">SeekOrigin</A> origin)</PRE>
|
||
|
<DL>
|
||
|
<DD>Sets the position within the current stream to the specified value.
|
||
|
<P>
|
||
|
<DD><DL>
|
||
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../System/IO/Stream.html#Seek(long, System.IO.SeekOrigin)">Seek</A></CODE> in class <CODE><A HREF="../../System/IO/Stream.html" title="class in System.IO">Stream</A></CODE></DL>
|
||
|
</DD>
|
||
|
<DD><DL>
|
||
|
<DT><B>Parameters:</B><DD><CODE>offset</CODE> - The new position within the stream. This is relative to the origin parameter, and can be positive or negative.<DD><CODE>origin</CODE> - A value of type SeekOrigin, which acts as the seek reference point.
|
||
|
<DT><B>Returns:</B><DD>The new position within the stream, calculated by combining the initial reference point and the offset.
|
||
|
<DT><B>Throws:</B>
|
||
|
<DD><CODE><A HREF="../../System/ArgumentOutOfRangeException.html" title="class in System">ArgumentOutOfRangeException</A></CODE> - offset is greater than MaxValue.
|
||
|
<DD><CODE><A HREF="../../System/ObjectDisposedException.html" title="class in System">ObjectDisposedException</A></CODE> - The current stream instance is closed.
|
||
|
<DD><CODE><A HREF="../../System/IO/IOException.html" title="class in System.IO">IOException</A></CODE> - Seeking is attempted before the beginning of the stream.
|
||
|
<DD><CODE><A HREF="../../System/ArgumentException.html" title="class in System">ArgumentException</A></CODE></DL>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="SetLength(long)"><!-- --></A><H3>
|
||
|
SetLength</H3>
|
||
|
<PRE>
|
||
|
public void <B>SetLength</B>(long value)</PRE>
|
||
|
<DL>
|
||
|
<DD>Sets the length of the current stream to the specified value.
|
||
|
<P>
|
||
|
<DD><DL>
|
||
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../System/IO/Stream.html#SetLength(long)">SetLength</A></CODE> in class <CODE><A HREF="../../System/IO/Stream.html" title="class in System.IO">Stream</A></CODE></DL>
|
||
|
</DD>
|
||
|
<DD><DL>
|
||
|
<DT><B>Parameters:</B><DD><CODE>value</CODE> - The value at which to set the length.
|
||
|
<DT><B>Throws:</B>
|
||
|
<DD><CODE><A HREF="../../System/ArgumentOutOfRangeException.html" title="class in System">ArgumentOutOfRangeException</A></CODE> - value is negative or is greater than the maximum length of the MemoryStream, where the maximum length is (MaxValue - origin), and origin is the index into the underlying buffer at which the stream starts.
|
||
|
<DD><CODE><A HREF="../../System/NotSupportedException.html" title="class in System">NotSupportedException</A></CODE> - The current stream is not resizable and value is larger than the current capacity.-or- The current stream does not support writing.</DL>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="ToArray()"><!-- --></A><H3>
|
||
|
ToArray</H3>
|
||
|
<PRE>
|
||
|
public byte[] <B>ToArray</B>()</PRE>
|
||
|
<DL>
|
||
|
<DD>Writes the entire stream contents to a byte array, regardless of the Position property.
|
||
|
<P>
|
||
|
<DD><DL>
|
||
|
|
||
|
<DT><B>Returns:</B><DD>A new byte array.</DL>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="WriteByte(byte)"><!-- --></A><H3>
|
||
|
WriteByte</H3>
|
||
|
<PRE>
|
||
|
public void <B>WriteByte</B>(byte value)</PRE>
|
||
|
<DL>
|
||
|
<DD>Writes a byte to the current stream at the current position.
|
||
|
<P>
|
||
|
<DD><DL>
|
||
|
<DT><B>Overrides:</B><DD><CODE><A HREF="../../System/IO/Stream.html#WriteByte(byte)">WriteByte</A></CODE> in class <CODE><A HREF="../../System/IO/Stream.html" title="class in System.IO">Stream</A></CODE></DL>
|
||
|
</DD>
|
||
|
<DD><DL>
|
||
|
<DT><B>Parameters:</B><DD><CODE>value</CODE> - The byte to write.
|
||
|
<DT><B>Throws:</B>
|
||
|
<DD><CODE><A HREF="../../System/NotSupportedException.html" title="class in System">NotSupportedException</A></CODE> - The stream does not support writing. For additional information see CanWrite.-or- The current position is at the end of the stream, and the capacity cannot be modified.
|
||
|
<DD><CODE><A HREF="../../System/ObjectDisposedException.html" title="class in System">ObjectDisposedException</A></CODE> - The current stream is closed.</DL>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="Write(byte[], int, int)"><!-- --></A><H3>
|
||
|
Write</H3>
|
||
|
<PRE>
|
||
|
public void <B>Write</B>(byte[] buffer,
|
||
|
int offset,
|
||
|
int count)</PRE>
|
||
|
<DL>
|
||
|
<DD>Writes a block of bytes to the current stream using data read from buffer.
|
||
|
<P>
|
||
|
<DD><DL>
|
||
|
<DT><B>Specified by:</B><DD><CODE><A HREF="../../System/IO/Stream.html#Write(byte[], int, int)">Write</A></CODE> in class <CODE><A HREF="../../System/IO/Stream.html" title="class in System.IO">Stream</A></CODE></DL>
|
||
|
</DD>
|
||
|
<DD><DL>
|
||
|
<DT><B>Parameters:</B><DD><CODE>buffer</CODE> - The buffer to write data from.<DD><CODE>offset</CODE> - The byte offset in buffer at which to begin writing from.<DD><CODE>count</CODE> - The maximum number of bytes to write.
|
||
|
<DT><B>Throws:</B>
|
||
|
<DD><CODE><A HREF="../../System/ObjectDisposedException.html" title="class in System">ObjectDisposedException</A></CODE> - The current stream is closed.
|
||
|
<DD><CODE><A HREF="../../System/NotSupportedException.html" title="class in System">NotSupportedException</A></CODE> - The stream does not support writing. For additional information see CanWrite.-or- The current position is closer than count bytes to the end of the stream, and the capacity cannot be modified.
|
||
|
<DD><CODE><A HREF="../../System/ArgumentNullException.html" title="class in System">ArgumentNullException</A></CODE> - buffer is null.
|
||
|
<DD><CODE><A HREF="../../System/IO/IOException.html" title="class in System.IO">IOException</A></CODE> - An I/O error occurs.</DL>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="WriteTo(System.IO.Stream)"><!-- --></A><H3>
|
||
|
WriteTo</H3>
|
||
|
<PRE>
|
||
|
public void <B>WriteTo</B>(<A HREF="../../System/IO/Stream.html" title="class in System.IO">Stream</A> stream)</PRE>
|
||
|
<DL>
|
||
|
<DD>Writes the entire contents of this memory stream to another stream.
|
||
|
<P>
|
||
|
<DD><DL>
|
||
|
<DT><B>Parameters:</B><DD><CODE>stream</CODE> - The stream to write this memory stream to.
|
||
|
<DT><B>Throws:</B>
|
||
|
<DD><CODE><A HREF="../../System/ArgumentNullException.html" title="class in System">ArgumentNullException</A></CODE> - stream is null.
|
||
|
<DD><CODE><A HREF="../../System/ObjectDisposedException.html" title="class in System">ObjectDisposedException</A></CODE> - The current or target stream is closed.</DL>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<HR>
|
||
|
|
||
|
<A NAME="WriteTo(java.io.OutputStream)"><!-- --></A><H3>
|
||
|
WriteTo</H3>
|
||
|
<PRE>
|
||
|
public void <B>WriteTo</B>(java.io.OutputStream stream)</PRE>
|
||
|
<DL>
|
||
|
<DD>Writes the entire contents of this memory stream to a java.io.OutputStream.
|
||
|
<P>
|
||
|
<DD><DL>
|
||
|
<DT><B>Parameters:</B><DD><CODE>stream</CODE> - The stream to write this memory stream to.
|
||
|
<DT><B>Throws:</B>
|
||
|
<DD><CODE><A HREF="../../System/ArgumentNullException.html" title="class in System">ArgumentNullException</A></CODE> - stream is null.
|
||
|
<DD><CODE><A HREF="../../System/ObjectDisposedException.html" title="class in System">ObjectDisposedException</A></CODE> - The current or target stream is closed.</DL>
|
||
|
</DD>
|
||
|
</DL>
|
||
|
<!-- ========= END OF CLASS DATA ========= -->
|
||
|
<HR>
|
||
|
|
||
|
|
||
|
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
||
|
<A NAME="navbar_bottom"><!-- --></A>
|
||
|
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
|
||
|
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||
|
<TR>
|
||
|
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||
|
<A NAME="navbar_bottom_firstrow"><!-- --></A>
|
||
|
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||
|
<TR ALIGN="center" VALIGN="top">
|
||
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
|
||
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
||
|
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
|
||
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/MemoryStream.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
|
||
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
||
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
||
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
||
|
</TR>
|
||
|
</TABLE>
|
||
|
</TD>
|
||
|
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||
|
</EM>
|
||
|
</TD>
|
||
|
</TR>
|
||
|
|
||
|
<TR>
|
||
|
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||
|
<A HREF="../../System/IO/IOException.html" title="class in System.IO"><B>PREV CLASS</B></A>
|
||
|
<A HREF="../../System/IO/PathTooLongException.html" title="class in System.IO"><B>NEXT CLASS</B></A></FONT></TD>
|
||
|
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||
|
<A HREF="../../index.html?System/IO/MemoryStream.html" target="_top"><B>FRAMES</B></A>
|
||
|
<A HREF="MemoryStream.html" target="_top"><B>NO FRAMES</B></A>
|
||
|
<SCRIPT type="text/javascript">
|
||
|
<!--
|
||
|
if(window==top) {
|
||
|
document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
|
||
|
}
|
||
|
//-->
|
||
|
</SCRIPT>
|
||
|
<NOSCRIPT>
|
||
|
<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
|
||
|
</NOSCRIPT>
|
||
|
|
||
|
|
||
|
</FONT></TD>
|
||
|
</TR>
|
||
|
<TR>
|
||
|
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
||
|
SUMMARY: NESTED | <A HREF="#fields_inherited_from_class_System.IO.Stream">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
||
|
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
||
|
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
|
||
|
</TR>
|
||
|
</TABLE>
|
||
|
<A NAME="skip-navbar_bottom"></A>
|
||
|
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
||
|
|
||
|
<HR>
|
||
|
|
||
|
</BODY>
|
||
|
</HTML>
|