<!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.4.2_03) on Mon Oct 10 16:31:46 CEST 2005 -->
<TITLE>
ByteArrayInputStream (IM Profile)
</TITLE>

<META NAME="keywords" CONTENT="java.io.ByteArrayInputStream class">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    parent.document.title="ByteArrayInputStream (IM Profile)";
}
</SCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">


<!-- ========= 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=3 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>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/ByteArrayInputStream.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<strong>IM Profile</strong></EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV CLASS&nbsp;
&nbsp;<A HREF="../../java/io/ByteArrayOutputStream.html" title="class in java.io"><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>  &nbsp;
&nbsp;<A HREF="ByteArrayInputStream.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<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:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<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">
java.io</FONT>
<BR>
Class ByteArrayInputStream</H2>
<PRE>
<A HREF="../../java/lang/Object.html" title="class in java.lang">java.lang.Object</A>
  <IMG SRC="../../resources/inherit.gif" ALT="extended by"><A HREF="../../java/io/InputStream.html" title="class in java.io">java.io.InputStream</A>
      <IMG SRC="../../resources/inherit.gif" ALT="extended by"><B>java.io.ByteArrayInputStream</B>
</PRE>
<HR>
<DL>
<DT>public class <B>ByteArrayInputStream</B><DT>extends <A HREF="../../java/io/InputStream.html" title="class in java.io">InputStream</A></DL>

<P>
A <code>ByteArrayInputStream</code> contains
 an internal buffer that contains bytes that
 may be read from the stream. An internal
 counter keeps track of the next byte to
 be supplied by the <code>read</code> method.
<P>

<P>
<DL>
<DT><B>Since:</B></DT>
  <DD>JDK1.0, CLDC 1.0</DD>
</DL>
<HR>

<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->


<!-- =========== FIELD SUMMARY =========== -->

<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Field Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;byte[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/io/ByteArrayInputStream.html#buf">buf</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;An array of bytes that was provided
 by the creator of the stream. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/io/ByteArrayInputStream.html#count">count</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The index one greater than the last valid character in the input
 stream buffer.
 </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/io/ByteArrayInputStream.html#mark">mark</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The currently marked position in the stream.
 </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/io/ByteArrayInputStream.html#pos">pos</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The index of the next character to read from the input stream buffer.
 </TD>
</TR>
</TABLE>
&nbsp;
<!-- ======== CONSTRUCTOR SUMMARY ======== -->

<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../java/io/ByteArrayInputStream.html#ByteArrayInputStream(byte[])">ByteArrayInputStream</A></B>(byte[]&nbsp;buf)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a <code>ByteArrayInputStream</code>
 so that it  uses <code>buf</code> as its
 buffer array.
 </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../java/io/ByteArrayInputStream.html#ByteArrayInputStream(byte[], int, int)">ByteArrayInputStream</A></B>(byte[]&nbsp;buf,
                     int&nbsp;offset,
                     int&nbsp;length)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates <code>ByteArrayInputStream</code>
 that uses <code>buf</code> as its
 buffer array. </TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/io/ByteArrayInputStream.html#available()">available</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the number of bytes that can be read from this input
 stream without blocking.
 </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/io/ByteArrayInputStream.html#close()">close</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Closes this input stream and releases any system resources
 associated with the stream.
 </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/io/ByteArrayInputStream.html#mark(int)">mark</A></B>(int&nbsp;readAheadLimit)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the current marked position in the stream.
 </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/io/ByteArrayInputStream.html#markSupported()">markSupported</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tests if ByteArrayInputStream supports mark/reset.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/io/ByteArrayInputStream.html#read()">read</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reads the next byte of data from this input stream. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/io/ByteArrayInputStream.html#read(byte[], int, int)">read</A></B>(byte[]&nbsp;b,
     int&nbsp;off,
     int&nbsp;len)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reads up to <code>len</code> bytes of data into an array of bytes
 from this input stream.
 </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/io/ByteArrayInputStream.html#reset()">reset</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Resets the buffer to the marked position.  </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;long</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/io/ByteArrayInputStream.html#skip(long)">skip</A></B>(long&nbsp;n)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Skips <code>n</code> bytes of input from this input stream. </TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.io.InputStream"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.io.<A HREF="../../java/io/InputStream.html" title="class in java.io">InputStream</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../java/io/InputStream.html#read(byte[])">read</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<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">
<TD><B>Methods inherited from class java.lang.<A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<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#toString()">toString</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>
&nbsp;
<P>

<!-- ============ FIELD DETAIL =========== -->

<A NAME="field_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<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>An array of bytes that was provided
 by the creator of the stream. Elements <code>buf[0]</code>
 through <code>buf[count-1]</code> are the
 only bytes that can ever be read from the
 stream;  element <code>buf[pos]</code> is
 the next byte to be read.
<P>
<DL>
</DL>
</DL>
<HR>

<A NAME="pos"><!-- --></A><H3>
pos</H3>
<PRE>
protected int <B>pos</B></PRE>
<DL>
<DD>The index of the next character to read from the input stream buffer.
 This value should always be nonnegative
 and not larger than the value of <code>count</code>.
 The next byte to be read from the input stream buffer
 will be <code>buf[pos]</code>.
<P>
<DL>
</DL>
</DL>
<HR>

<A NAME="mark"><!-- --></A><H3>
mark</H3>
<PRE>
protected int <B>mark</B></PRE>
<DL>
<DD>The currently marked position in the stream.
 ByteArrayInputStream objects are marked at position zero by
 default when constructed.  They may be marked at another
 position within the buffer by the <code>mark()</code> method.
 The current buffer position is set to this point by the
 <code>reset()</code> method.
<P>
<DL>
<DT><B>Since:</B></DT>
  <DD>JDK1.1</DD>
</DL>
</DL>
<HR>

<A NAME="count"><!-- --></A><H3>
count</H3>
<PRE>
protected int <B>count</B></PRE>
<DL>
<DD>The index one greater than the last valid character in the input
 stream buffer.
 This value should always be nonnegative
 and not larger than the length of <code>buf</code>.
 It  is one greater than the position of
 the last byte within <code>buf</code> that
 can ever be read  from the input stream buffer.
<P>
<DL>
</DL>
</DL>

<!-- ========= CONSTRUCTOR DETAIL ======== -->

<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="ByteArrayInputStream(byte[])"><!-- --></A><H3>
ByteArrayInputStream</H3>
<PRE>
public <B>ByteArrayInputStream</B>(byte[]&nbsp;buf)</PRE>
<DL>
<DD>Creates a <code>ByteArrayInputStream</code>
 so that it  uses <code>buf</code> as its
 buffer array.
 The buffer array is not copied.
 The initial value of <code>pos</code>
 is <code>0</code> and the initial value
 of  <code>count</code> is the length of
 <code>buf</code>.
<P>
<DT><B>Parameters:</B><DD><CODE>buf</CODE> - the input buffer.</DL>
<HR>

<A NAME="ByteArrayInputStream(byte[], int, int)"><!-- --></A><H3>
ByteArrayInputStream</H3>
<PRE>
public <B>ByteArrayInputStream</B>(byte[]&nbsp;buf,
                            int&nbsp;offset,
                            int&nbsp;length)</PRE>
<DL>
<DD>Creates <code>ByteArrayInputStream</code>
 that uses <code>buf</code> as its
 buffer array. The initial value of <code>pos</code>
 is <code>offset</code> and the initial value
 of <code>count</code> is <code>offset+length</code>.
 The buffer array is not copied.
 <p>
 Note that if bytes are simply read from
 the resulting input stream, elements <code>buf[pos]</code>
 through <code>buf[pos+len-1]</code> will
 be read; however, if a <code>reset</code>
 operation  is performed, then bytes <code>buf[0]</code>
 through b<code>uf[pos-1]</code> will then
 become available for input.
<P>
<DT><B>Parameters:</B><DD><CODE>buf</CODE> - the input buffer.<DD><CODE>offset</CODE> - the offset in the buffer of the first byte to read.<DD><CODE>length</CODE> - the maximum number of bytes to read from the buffer.</DL>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="read()"><!-- --></A><H3>
read</H3>
<PRE>
public int <B>read</B>()</PRE>
<DL>
<DD>Reads the next byte of data from this input stream. The value
 byte is returned as an <code>int</code> in the range
 <code>0</code> to <code>255</code>. If no byte is available
 because the end of the stream has been reached, the value
 <code>-1</code> is returned.
 <p>
 This <code>read</code> method
 cannot block.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../java/io/InputStream.html#read()">read</A></CODE> in class <CODE><A HREF="../../java/io/InputStream.html" title="class in java.io">InputStream</A></CODE></DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD>the next byte of data, or <code>-1</code> if the end of the
          stream has been reached.</DL>
</DD>
</DL>
<HR>

<A NAME="read(byte[], int, int)"><!-- --></A><H3>
read</H3>
<PRE>
public int <B>read</B>(byte[]&nbsp;b,
                int&nbsp;off,
                int&nbsp;len)</PRE>
<DL>
<DD>Reads up to <code>len</code> bytes of data into an array of bytes
 from this input stream.
 If <code>pos</code> equals <code>count</code>,
 then <code>-1</code> is returned to indicate
 end of file. Otherwise, the  number <code>k</code>
 of bytes read is equal to the smaller of
 <code>len</code> and <code>count-pos</code>.
 If <code>k</code> is positive, then bytes
 <code>buf[pos]</code> through <code>buf[pos+k-1]</code>
 are copied into <code>b[off]</code>  through
 <code>b[off+k-1]</code> in the manner performed
 by <code>System.arraycopy</code>. The
 value <code>k</code> is added into <code>pos</code>
 and <code>k</code> is returned.
 <p>
 This <code>read</code> method cannot block.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../java/io/InputStream.html#read(byte[], int, int)">read</A></CODE> in class <CODE><A HREF="../../java/io/InputStream.html" title="class in java.io">InputStream</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>b</CODE> - the buffer into which the data is read.<DD><CODE>off</CODE> - the start offset of the data.<DD><CODE>len</CODE> - the maximum number of bytes read.
<DT><B>Returns:</B><DD>the total number of bytes read into the buffer, or
          <code>-1</code> if there is no more data because the end of
          the stream has been reached.<DT><B>See Also:</B><DD><A HREF="../../java/io/InputStream.html#read()"><CODE>InputStream.read()</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="skip(long)"><!-- --></A><H3>
skip</H3>
<PRE>
public long <B>skip</B>(long&nbsp;n)</PRE>
<DL>
<DD>Skips <code>n</code> bytes of input from this input stream. Fewer
 bytes might be skipped if the end of the input stream is reached.
 The actual number <code>k</code>
 of bytes to be skipped is equal to the smaller
 of <code>n</code> and  <code>count-pos</code>.
 The value <code>k</code> is added into <code>pos</code>
 and <code>k</code> is returned.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../java/io/InputStream.html#skip(long)">skip</A></CODE> in class <CODE><A HREF="../../java/io/InputStream.html" title="class in java.io">InputStream</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>n</CODE> - the number of bytes to be skipped.
<DT><B>Returns:</B><DD>the actual number of bytes skipped.</DL>
</DD>
</DL>
<HR>

<A NAME="available()"><!-- --></A><H3>
available</H3>
<PRE>
public int <B>available</B>()</PRE>
<DL>
<DD>Returns the number of bytes that can be read from this input
 stream without blocking.
 The value returned is
 <code>count&nbsp;- pos</code>,
 which is the number of bytes remaining to be read from the input buffer.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../java/io/InputStream.html#available()">available</A></CODE> in class <CODE><A HREF="../../java/io/InputStream.html" title="class in java.io">InputStream</A></CODE></DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD>the number of bytes that can be read from the input stream
          without blocking.</DL>
</DD>
</DL>
<HR>

<A NAME="markSupported()"><!-- --></A><H3>
markSupported</H3>
<PRE>
public boolean <B>markSupported</B>()</PRE>
<DL>
<DD>Tests if ByteArrayInputStream supports mark/reset.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../java/io/InputStream.html#markSupported()">markSupported</A></CODE> in class <CODE><A HREF="../../java/io/InputStream.html" title="class in java.io">InputStream</A></CODE></DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD><code>true</code> if this true type supports the mark and reset
          method; <code>false</code> otherwise.<DT><B>Since:</B></DT>
  <DD>JDK1.1</DD>
<DT><B>See Also:</B><DD><A HREF="../../java/io/InputStream.html#mark(int)"><CODE>InputStream.mark(int)</CODE></A>, 
<A HREF="../../java/io/InputStream.html#reset()"><CODE>InputStream.reset()</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="mark(int)"><!-- --></A><H3>
mark</H3>
<PRE>
public void <B>mark</B>(int&nbsp;readAheadLimit)</PRE>
<DL>
<DD>Set the current marked position in the stream.
 ByteArrayInputStream objects are marked at position zero by
 default when constructed.  They may be marked at another
 position within the buffer by this method.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../java/io/InputStream.html#mark(int)">mark</A></CODE> in class <CODE><A HREF="../../java/io/InputStream.html" title="class in java.io">InputStream</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>readAheadLimit</CODE> - the maximum limit of bytes that can be read before
                      the mark position becomes invalid.<DT><B>Since:</B></DT>
  <DD>JDK1.1</DD>
<DT><B>See Also:</B><DD><A HREF="../../java/io/InputStream.html#reset()"><CODE>InputStream.reset()</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="reset()"><!-- --></A><H3>
reset</H3>
<PRE>
public void <B>reset</B>()</PRE>
<DL>
<DD>Resets the buffer to the marked position.  The marked position
 is the beginning unless another position was marked.
 The value of <code>pos</code> is set to 0.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../java/io/InputStream.html#reset()">reset</A></CODE> in class <CODE><A HREF="../../java/io/InputStream.html" title="class in java.io">InputStream</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>See Also:</B><DD><A HREF="../../java/io/InputStream.html#mark(int)"><CODE>InputStream.mark(int)</CODE></A>, 
<A HREF="../../java/io/IOException.html" title="class in java.io"><CODE>IOException</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="close()"><!-- --></A><H3>
close</H3>
<PRE>
public void <B>close</B>()
           throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
<DL>
<DD>Closes this input stream and releases any system resources
 associated with the stream.
 <p>
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../java/io/InputStream.html#close()">close</A></CODE> in class <CODE><A HREF="../../java/io/InputStream.html" title="class in java.io">InputStream</A></CODE></DL>
</DD>
<DD><DL>

<DT><B>Throws:</B>
<DD><CODE><A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></CODE> - if an I/O error occurs.</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=3 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>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/ByteArrayInputStream.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<strong>IM Profile</strong></EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV CLASS&nbsp;
&nbsp;<A HREF="../../java/io/ByteArrayOutputStream.html" title="class in java.io"><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>  &nbsp;
&nbsp;<A HREF="ByteArrayInputStream.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<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:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>
<font size=\-1\><a href=\mailto:midp-feedback@risc.sps.mot.com\>Submit a comment or suggestion</a> Version 2.0 of IM 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>
