📄 bytearrayoutputstream.html
字号:
<TD><CODE><A HREF="../../java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../java/lang/Object.html#hashCode()">hashCode</A>, <A HREF="../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../java/lang/Object.html#wait(long)">wait</A>, <A HREF="../../java/lang/Object.html#wait(long, int)">wait</A></CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<A NAME="field_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Field Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="buf"><!-- --></A><H3>
buf</H3>
<PRE>
protected byte[] <B>buf</B></PRE>
<DL>
<DD>The buffer where data is stored.</DL>
<HR>
<A NAME="count"><!-- --></A><H3>
count</H3>
<PRE>
protected int <B>count</B></PRE>
<DL>
<DD>The number of valid bytes in the buffer.</DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="ByteArrayOutputStream()"><!-- --></A><H3>
ByteArrayOutputStream</H3>
<PRE>
public <B>ByteArrayOutputStream</B>()</PRE>
<DL>
<DD>Creates a new byte array output stream. The buffer capacity is initially 32 bytes, though its size increases if necessary.</DL>
<HR>
<A NAME="ByteArrayOutputStream(int)"><!-- --></A><H3>
ByteArrayOutputStream</H3>
<PRE>
public <B>ByteArrayOutputStream</B>(int size)</PRE>
<DL>
<DD>Creates a new byte array output stream, with a buffer capacity of the specified size, in bytes.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>size</CODE> - the initial size.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if size is negative.</DL>
</DD>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="write(int)"><!-- --></A><H3>
write</H3>
<PRE>
public void <B>write</B>(int b)</PRE>
<DL>
<DD>Writes the specified byte to this byte array output stream.<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../java/io/OutputStream.html#write(int)">write</A></CODE> in class <CODE><A HREF="../../java/io/OutputStream.html">OutputStream</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>b</CODE> - the byte to be written.</DL>
</DD>
</DL>
<HR>
<A NAME="write(byte[], int, int)"><!-- --></A><H3>
write</H3>
<PRE>
public void <B>write</B>(byte[] b, int off, int len)</PRE>
<DL>
<DD>Writes <code>len</code> bytes from the specified byte array starting at offset <code>off</code> to this byte array output stream.<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../java/io/OutputStream.html#write(byte[], int, int)">write</A></CODE> in class <CODE><A HREF="../../java/io/OutputStream.html">OutputStream</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>b</CODE> - the data.<DD><CODE>off</CODE> - the start offset in the data.<DD><CODE>len</CODE> - the number of bytes to write.</DL>
</DD>
</DL>
<HR>
<A NAME="reset()"><!-- --></A><H3>
reset</H3>
<PRE>
public void <B>reset</B>()</PRE>
<DL>
<DD>Resets the <code>count</code> field of this byte array output stream to zero, so that all currently accumulated output in the output stream is discarded. The output stream can be used again, reusing the already allocated buffer space.<DD><DL>
<DT><B>See Also: </B><DD><A HREF="../../java/io/ByteArrayInputStream.html#count"><CODE>ByteArrayInputStream.count</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="toByteArray()"><!-- --></A><H3>
toByteArray</H3>
<PRE>
public byte[] <B>toByteArray</B>()</PRE>
<DL>
<DD>Creates a newly allocated byte array. Its size is the current size of this output stream and the valid contents of the buffer have been copied into it.<DD><DL>
<DT><B>Returns:</B><DD>the current contents of this output stream, as a byte array.<DT><B>See Also: </B><DD><A HREF="../../java/io/ByteArrayOutputStream.html#size()"><CODE>size()</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="size()"><!-- --></A><H3>
size</H3>
<PRE>
public int <B>size</B>()</PRE>
<DL>
<DD>Returns the current size of the buffer.<DD><DL>
<DT><B>Returns:</B><DD>the value of the <code>count</code> field, which is the number of valid bytes in this output stream.<DT><B>See Also: </B><DD><A HREF="../../java/io/ByteArrayOutputStream.html#count"><CODE>count</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="toString()"><!-- --></A><H3>
toString</H3>
<PRE>
public <A HREF="../../java/lang/String.html">String</A> <B>toString</B>()</PRE>
<DL>
<DD>Converts the buffer's contents into a string, translating bytes into characters according to the platform's default character encoding.<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../java/lang/Object.html#toString()">toString</A></CODE> in class <CODE><A HREF="../../java/lang/Object.html">Object</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>String translated from the buffer's contents.<DT><B>Since: </B><DD>JDK1.1</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="close()"><!-- --></A><H3>
close</H3>
<PRE>
public void <B>close</B>() throws <A HREF="../../java/io/IOException.html">IOException</A></PRE>
<DL>
<DD>Closes this output stream and releases any system resources associated with this stream. A closed stream cannot perform output operations and cannot be reopened. <p><DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../java/io/OutputStream.html#close()">close</A></CODE> in class <CODE><A HREF="../../java/io/OutputStream.html">OutputStream</A></CODE></DL>
</DD>
<DD>Following copied from class: <CODE>java.io.OutputStream</CODE></DD>
<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="../../java/io/IOException.html">IOException</A></CODE> - if an I/O error occurs.</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<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/ByteArrayOutputStream.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-all.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>
<strong>MID Profile</strong></EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../java/io/ByteArrayInputStream.html"><B>PREV CLASS</B></A>
<A HREF="../../java/io/DataInputStream.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A>
<A HREF="ByteArrayOutputStream.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: INNER | <A HREF="#field_summary">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: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
<font size="-1"><a href="mailto:midp-feedback@risc.sps.mot.com">Submit a comment or suggestion</a> Version 2.0 of MID Profile Specification<br>Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries. Copyright (c) 1993-2002 Sun Microsystems, Inc. 901 San Antonio Road,Palo Alto, California, 94303, U.S.A. All Rights Reserved.</font>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -