<!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_23) on Sat May 28 12:33:42 CEST 2011 -->
<TITLE>
IBuffer (Net4j API Specification)
</TITLE>
<META NAME="date" CONTENT="2011-05-28">
<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="IBuffer (Net4j API Specification)";
}
}
</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/IBuffer.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>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../org/eclipse/net4j/buffer/BufferState.html" title="enum in org.eclipse.net4j.buffer"><B>PREV CLASS</B></A>
<A HREF="../../../../org/eclipse/net4j/buffer/IBufferHandler.html" title="interface in org.eclipse.net4j.buffer"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?org/eclipse/net4j/buffer/IBuffer.html" target="_top"><B>FRAMES</B></A>
<A HREF="IBuffer.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="#field_summary">FIELD</A> | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | CONSTR | <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">
org.eclipse.net4j.buffer</FONT>
<BR>
Interface IBuffer</H2>
<DL>
<DT><B>All Known Subinterfaces:</B> <DD><A HREF="../../../../org/eclipse/spi/net4j/InternalBuffer.html" title="interface in org.eclipse.spi.net4j">InternalBuffer</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public interface <B>IBuffer</B></DL>
</PRE>
<P>
Basic <b>unit of transport</b> in Net4j.
<p>
A buffer is well prepared for the usage with asynchronous <A HREF="../../../../org/eclipse/net4j/channel/IChannel.html" title="interface in org.eclipse.net4j.channel"><CODE>IChannel</CODE></A>s but can also be used with pure
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/channels/SocketChannel.html?is-external=true" title="class or interface in java.nio.channels"><CODE>SocketChannel</CODE></A>s. All methods of <code>IBuffer</code> are non-blocking.
<p>
Usually buffers are obtained from a <A HREF="../../../../org/eclipse/net4j/buffer/IBufferProvider.html" title="interface in org.eclipse.net4j.buffer"><CODE>IBufferProvider</CODE></A>. Buffers can be accessed, passed around and finally
<A HREF="../../../../org/eclipse/net4j/buffer/IBuffer.html#release()"><CODE>released</CODE></A> to their original provider. The capacity of a buffer is determined by its provider.
<p>
In addition to its payload data each buffer contains an internal header of four bytes, two of them representing a
channel identifier the other two of them denoting the length of the payload data. The payload data may be accessed
through a <A HREF="../../../../org/eclipse/net4j/buffer/IBuffer.html#getByteBuffer()"><CODE>ByteBuffer</CODE></A>.
<p>
This interface is <b>not</b> intended to be implemented by clients.
<p>
<dt><b>Class Diagram:</b></dt>
<dd><img src="doc-files/IBuffer-1.gif" title="Diagram Buffers" border="0" usemap="#IBuffer-1.gif"/></dd>
<p>
<MAP NAME="IBuffer-1.gif"> <AREA SHAPE="RECT" COORDS="303,12,403,72" HREF="IBufferHandler.html"> <AREA SHAPE="RECT"
COORDS="533,199,619,249" HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/nio/ByteBuffer.html"> <AREA SHAPE="RECT"
COORDS="283,126,422,322" HREF="IBuffer.html"> <AREA SHAPE="RECT" COORDS="9,180,155,268" HREF="IBufferProvider.html">
<AREA SHAPE="RECT" COORDS="33,321,132,399" HREF="IBufferPool.html"></MAP>
<p>
<dt><b>State Machine Diagram:</b></dt>
<dd><img src="doc-files/BufferState-1.gif" title="Diagram Buffer States" border="0" usemap="#BufferState-1.gif"/></dd>
<p>
<MAP NAME="BufferState-1.gif"> <AREA SHAPE="RECT" COORDS="300,8,449,34" HREF="BufferState.html#INITIAL"> <AREA
SHAPE="RECT" COORDS="46,115,195,139" HREF="BufferState.html#PUTTING"> <AREA SHAPE="RECT" COORDS="48,271,195,295"
HREF="BufferState.html#WRITING"> <AREA SHAPE="RECT" COORDS="533,112,681,140" HREF="BufferState.html#READING_HEADER">
<AREA SHAPE="RECT" COORDS="533,271,680,295" HREF="BufferState.html#READING_BODY"> <AREA SHAPE="RECT"
COORDS="532,428,682,451" HREF="BufferState.html#GETTING"> </MAP>
<p>
An example for <b>putting</b> values into a buffer and writing it to a <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/channels/SocketChannel.html?is-external=true" title="class or interface in java.nio.channels"><CODE>SocketChannel</CODE></A>:
<p>
<pre style="background-color:#ffffc8; border-width:1px; border-style:solid; padding:.5em;">
// Obtain a fresh buffer
Buffer buffer = bufferProvider.getBuffer(); // Start filling the buffer for channelID 4711 ByteBuffer byteBuffer =
buffer.startPutting(4711); byteBuffer.putDouble(15.47); // Write the contents of the Buffer to a // SocketChannel
without blocking while (!buffer.write(socketChannel)) { // Do something else }
</pre>
An example for reading a buffer from a <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/channels/SocketChannel.html?is-external=true" title="class or interface in java.nio.channels"><CODE>SocketChannel</CODE></A> and <b>getting</b> values from it:
<p>
<pre style="background-color:#ffffc8; border-width:1px; border-style:solid; padding:.5em;">
// Obtain a fresh buffer
Buffer buffer = bufferProvider.getBuffer();
// Read the contents of the Buffer from a SocketChannel without blocking
ByteBuffer byteBuffer;
while ((byteBuffer = buffer.startGetting(socketChannel)) == null)
{
// Do something else
}
// Access the contents of the buffer and release it to its provider
double value = byteBuffer.getDouble();
buffer.release();
</pre>
<P>
<P>
<DL>
<DT><B>Author:</B></DT>
<DD>Eike Stepper</DD>
<DT><B>See Also:</B><DD><A HREF="../../../../org/eclipse/net4j/buffer/IBufferProvider.html" title="interface in org.eclipse.net4j.buffer"><CODE>IBufferProvider</CODE></A>,
<A HREF="../../../../org/eclipse/net4j/channel/IChannel.html#sendBuffer(org.eclipse.net4j.buffer.IBuffer)"><CODE>IChannel.sendBuffer(IBuffer)</CODE></A>,
<A HREF="../../../../org/eclipse/net4j/channel/IChannel.html#setReceiveHandler(org.eclipse.net4j.buffer.IBufferHandler)"><CODE>IChannel.setReceiveHandler(IBufferHandler)</CODE></A>,
<A HREF="../../../../org/eclipse/net4j/buffer/IBufferHandler.html#handleBuffer(org.eclipse.net4j.buffer.IBuffer)"><CODE>IBufferHandler.handleBuffer(IBuffer)</CODE></A><DT><B>No Implement</B></DT>
<DD>This interface is not intended to be implemented by clients.</DD>
<DT><B>No Extend</B></DT>
<DD>This interface is not intended to be extended by clients.</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>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static short</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/net4j/buffer/IBuffer.html#HEADER_SIZE">HEADER_SIZE</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static short</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/net4j/buffer/IBuffer.html#MAX_CHANNEL">MAX_CHANNEL</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static short</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/net4j/buffer/IBuffer.html#MIN_CHANNEL">MIN_CHANNEL</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static short</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/net4j/buffer/IBuffer.html#NO_CHANNEL">NO_CHANNEL</A></B></CODE>
<BR>
Possible argument value of <A HREF="../../../../org/eclipse/net4j/buffer/IBuffer.html#startPutting(short)"><CODE>startPutting(short)</CODE></A> and possible return value of <A HREF="../../../../org/eclipse/net4j/buffer/IBuffer.html#getChannelID()"><CODE>getChannelID()</CODE></A> that
indicates that this buffer is not intended to be passed to a <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/channels/SocketChannel.html?is-external=true" title="class or interface in java.nio.channels"><CODE>SocketChannel</CODE></A>.</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> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/net4j/buffer/IBuffer.html#clear()">clear</A></B>()</CODE>
<BR>
Turns the state of this buffer from any state into <A HREF="../../../../org/eclipse/net4j/buffer/BufferState.html#INITIAL"><CODE>INITIAL</CODE></A>.</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="../../../../org/eclipse/net4j/buffer/IBuffer.html#flip()">flip</A></B>()</CODE>
<BR>
Turns the state of this buffer from <A HREF="../../../../org/eclipse/net4j/buffer/BufferState.html#PUTTING"><CODE>PUTTING</CODE></A> into <A HREF="../../../../org/eclipse/net4j/buffer/BufferState.html#GETTING"><CODE>GETTING</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/net4j/buffer/IBuffer.html#formatContent(boolean)">formatContent</A></B>(boolean showHeader)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/eclipse/net4j/buffer/IBufferProvider.html" title="interface in org.eclipse.net4j.buffer">IBufferProvider</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/net4j/buffer/IBuffer.html#getBufferProvider()">getBufferProvider</A></B>()</CODE>
<BR>
Returns the <A HREF="../../../../org/eclipse/net4j/buffer/IBufferProvider.html" title="interface in org.eclipse.net4j.buffer"><CODE>IBufferProvider</CODE></A> that has provided this buffer and that this buffer will be returned to when its
<A HREF="../../../../org/eclipse/net4j/buffer/IBuffer.html#release()"><CODE>release()</CODE></A> method is called.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/net4j/buffer/IBuffer.html#getByteBuffer()">getByteBuffer</A></B>()</CODE>
<BR>
Returns the <code>ByteBuffer</code> that can be used for putting or getting data.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> short</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/net4j/buffer/IBuffer.html#getCapacity()">getCapacity</A></B>()</CODE>
<BR>
Returns the capacity of this buffer.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> short</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/net4j/buffer/IBuffer.html#getChannelID()">getChannelID</A></B>()</CODE>
<BR>
Returns the channel index value stored in the header of this buffer.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/eclipse/net4j/util/IErrorHandler.html" title="interface in org.eclipse.net4j.util">IErrorHandler</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/net4j/buffer/IBuffer.html#getErrorHandler()">getErrorHandler</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/eclipse/net4j/buffer/BufferState.html" title="enum in org.eclipse.net4j.buffer">BufferState</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/net4j/buffer/IBuffer.html#getState()">getState</A></B>()</CODE>
<BR>
Returns the internal state of this buffer.</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="../../../../org/eclipse/net4j/buffer/IBuffer.html#isEOS()">isEOS</A></B>()</CODE>
<BR>
Returns the <em>End Of Stream</em> flag to indicate whether this buffer is the last buffer in a stream of buffers.</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="../../../../org/eclipse/net4j/buffer/IBuffer.html#release()">release</A></B>()</CODE>
<BR>
Releases this buffer to its original <A HREF="../../../../org/eclipse/net4j/buffer/IBufferProvider.html" title="interface in org.eclipse.net4j.buffer"><CODE>IBufferProvider</CODE></A>.</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="../../../../org/eclipse/net4j/buffer/IBuffer.html#setEOS(boolean)">setEOS</A></B>(boolean eos)</CODE>
<BR>
Sets the <em>End Of Stream</em> flag to indicate whether this buffer is the last buffer in a stream of buffers.</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="../../../../org/eclipse/net4j/buffer/IBuffer.html#setErrorHandler(org.eclipse.net4j.util.IErrorHandler)">setErrorHandler</A></B>(<A HREF="../../../../org/eclipse/net4j/util/IErrorHandler.html" title="interface in org.eclipse.net4j.util">IErrorHandler</A> errorHandler)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/net4j/buffer/IBuffer.html#startGetting(java.nio.channels.SocketChannel)">startGetting</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/channels/SocketChannel.html?is-external=true" title="class or interface in java.nio.channels">SocketChannel</A> socketChannel)</CODE>
<BR>
Tries to read a <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio"><CODE>ByteBuffer</CODE></A> from a <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/channels/SocketChannel.html?is-external=true" title="class or interface in java.nio.channels"><CODE>SocketChannel</CODE></A> that can be used for getting data.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/net4j/buffer/IBuffer.html#startPutting(short)">startPutting</A></B>(short channelID)</CODE>
<BR>
Returns a <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio"><CODE>ByteBuffer</CODE></A> that can be used for putting data.</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="../../../../org/eclipse/net4j/buffer/IBuffer.html#write(java.nio.channels.SocketChannel)">write</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/channels/SocketChannel.html?is-external=true" title="class or interface in java.nio.channels">SocketChannel</A> socketChannel)</CODE>
<BR>
Tries to write the data of this buffer to a <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/channels/SocketChannel.html?is-external=true" title="class or interface in java.nio.channels"><CODE>SocketChannel</CODE></A>.</TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<A NAME="field_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>Field Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="NO_CHANNEL"><!-- --></A><H3>
NO_CHANNEL</H3>
<PRE>
static final short <B>NO_CHANNEL</B></PRE>
<DL>
<DD>Possible argument value of <A HREF="../../../../org/eclipse/net4j/buffer/IBuffer.html#startPutting(short)"><CODE>startPutting(short)</CODE></A> and possible return value of <A HREF="../../../../org/eclipse/net4j/buffer/IBuffer.html#getChannelID()"><CODE>getChannelID()</CODE></A> that
indicates that this buffer is not intended to be passed to a <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/channels/SocketChannel.html?is-external=true" title="class or interface in java.nio.channels"><CODE>SocketChannel</CODE></A>.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.eclipse.net4j.buffer.IBuffer.NO_CHANNEL">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="MIN_CHANNEL"><!-- --></A><H3>
MIN_CHANNEL</H3>
<PRE>
static final short <B>MIN_CHANNEL</B></PRE>
<DL>
<DL>
<DT><B>Since:</B></DT>
<DD>2.0</DD>
<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.eclipse.net4j.buffer.IBuffer.MIN_CHANNEL">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="MAX_CHANNEL"><!-- --></A><H3>
MAX_CHANNEL</H3>
<PRE>
static final short <B>MAX_CHANNEL</B></PRE>
<DL>
<DL>
<DT><B>Since:</B></DT>
<DD>2.0</DD>
<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.eclipse.net4j.buffer.IBuffer.MAX_CHANNEL">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="HEADER_SIZE"><!-- --></A><H3>
HEADER_SIZE</H3>
<PRE>
static final short <B>HEADER_SIZE</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.eclipse.net4j.buffer.IBuffer.HEADER_SIZE">Constant Field Values</A></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="getBufferProvider()"><!-- --></A><H3>
getBufferProvider</H3>
<PRE>
<A HREF="../../../../org/eclipse/net4j/buffer/IBufferProvider.html" title="interface in org.eclipse.net4j.buffer">IBufferProvider</A> <B>getBufferProvider</B>()</PRE>
<DL>
<DD>Returns the <A HREF="../../../../org/eclipse/net4j/buffer/IBufferProvider.html" title="interface in org.eclipse.net4j.buffer"><CODE>IBufferProvider</CODE></A> that has provided this buffer and that this buffer will be returned to when its
<A HREF="../../../../org/eclipse/net4j/buffer/IBuffer.html#release()"><CODE>release()</CODE></A> method is called.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getChannelID()"><!-- --></A><H3>
getChannelID</H3>
<PRE>
short <B>getChannelID</B>()</PRE>
<DL>
<DD>Returns the channel index value stored in the header of this buffer.
<P>
<DD><DL>
<DT><B>Since:</B></DT>
<DD>2.0</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="getCapacity()"><!-- --></A><H3>
getCapacity</H3>
<PRE>
short <B>getCapacity</B>()</PRE>
<DL>
<DD>Returns the capacity of this buffer.
<p>
The capacity of this buffer is equal to the <A HREF="../../../../org/eclipse/net4j/buffer/IBufferProvider.html#getBufferCapacity()"><CODE>capacity</CODE></A> of the
<A HREF="../../../../org/eclipse/net4j/buffer/IBufferProvider.html" title="interface in org.eclipse.net4j.buffer"><CODE>IBufferProvider</CODE></A> that has provided this buffer.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getState()"><!-- --></A><H3>
getState</H3>
<PRE>
<A HREF="../../../../org/eclipse/net4j/buffer/BufferState.html" title="enum in org.eclipse.net4j.buffer">BufferState</A> <B>getState</B>()</PRE>
<DL>
<DD>Returns the internal state of this buffer.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="startGetting(java.nio.channels.SocketChannel)"><!-- --></A><H3>
startGetting</H3>
<PRE>
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</A> <B>startGetting</B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/channels/SocketChannel.html?is-external=true" title="class or interface in java.nio.channels">SocketChannel</A> socketChannel)
throws <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A>,
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></PRE>
<DL>
<DD>Tries to read a <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio"><CODE>ByteBuffer</CODE></A> from a <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/channels/SocketChannel.html?is-external=true" title="class or interface in java.nio.channels"><CODE>SocketChannel</CODE></A> that can be used for getting data.
<p>
This method is non-blocking and it can be necessary to repeatedly call it. If it was not possible to read a
complete header from the <code>SocketChannel</code> <code>null</code> is returned and the state of this buffer is
<A HREF="../../../../org/eclipse/net4j/buffer/BufferState.html#READING_HEADER"><CODE>READING_HEADER</CODE></A>. If it was not possible to read a complete body from the
<code>SocketChannel</code> <code>null</code> is returned and the state of this buffer is
<A HREF="../../../../org/eclipse/net4j/buffer/BufferState.html#READING_BODY"><CODE>READING_BODY</CODE></A>.
<p>
If a <code>ByteBuffer</code> is returned it <b>may only</b> be used for getting data. It is left to the
responsibility of the caller that only the following methods of that <code>ByteBuffer</code> are used:
<ul>
<li> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true#get()" title="class or interface in java.nio"><CODE>ByteBuffer.get()</CODE></A>
<li> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true#get(byte[])" title="class or interface in java.nio"><CODE>ByteBuffer.get(byte[])</CODE></A>
<li> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true#get(int)" title="class or interface in java.nio"><CODE>ByteBuffer.get(int)</CODE></A>
<li> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true#get(byte[], int, int)" title="class or interface in java.nio"><CODE>ByteBuffer.get(byte[], int, int)</CODE></A>
<li> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true#getChar()" title="class or interface in java.nio"><CODE>ByteBuffer.getChar()</CODE></A>
<li> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true#getChar(int)" title="class or interface in java.nio"><CODE>ByteBuffer.getChar(int)</CODE></A>
<li> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true#getDouble()" title="class or interface in java.nio"><CODE>ByteBuffer.getDouble()</CODE></A>
<li> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true#getDouble(int)" title="class or interface in java.nio"><CODE>ByteBuffer.getDouble(int)</CODE></A>
<li> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true#getFloat()" title="class or interface in java.nio"><CODE>ByteBuffer.getFloat()</CODE></A>
<li> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true#getFloat(int)" title="class or interface in java.nio"><CODE>ByteBuffer.getFloat(int)</CODE></A>
<li> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true#getInt()" title="class or interface in java.nio"><CODE>ByteBuffer.getInt()</CODE></A>
<li> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true#getInt(int)" title="class or interface in java.nio"><CODE>ByteBuffer.getInt(int)</CODE></A>
<li> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true#getLong()" title="class or interface in java.nio"><CODE>ByteBuffer.getLong()</CODE></A>
<li> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true#getLong(int)" title="class or interface in java.nio"><CODE>ByteBuffer.getLong(int)</CODE></A>
<li> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true#getShort()" title="class or interface in java.nio"><CODE>ByteBuffer.getShort()</CODE></A>
<li> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true#getShort(int)" title="class or interface in java.nio"><CODE>ByteBuffer.getShort(int)</CODE></A>
<li>all other methods that do not influence <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/Buffer.html?is-external=true#position()" title="class or interface in java.nio"><CODE>Buffer.position()</CODE></A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/Buffer.html?is-external=true#limit()" title="class or interface in java.nio"><CODE>Buffer.limit()</CODE></A> and
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/Buffer.html?is-external=true#capacity()" title="class or interface in java.nio"><CODE>Buffer.capacity()</CODE></A>
</ul>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>socketChannel</CODE> - The <code>socketChannel</code> to read the <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio"><CODE>ByteBuffer</CODE></A> from.
<DT><B>Returns:</B><DD>A <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio"><CODE>ByteBuffer</CODE></A> that can be used for getting data if it was possible to completely read the data from
the given <code>SocketChannel</code>, <code>null</code> otherwise.
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - If the state of this buffer is not <A HREF="../../../../org/eclipse/net4j/buffer/BufferState.html#INITIAL"><CODE>INITIAL</CODE></A>,
<A HREF="../../../../org/eclipse/net4j/buffer/BufferState.html#READING_HEADER"><CODE>READING_HEADER</CODE></A> or <A HREF="../../../../org/eclipse/net4j/buffer/BufferState.html#READING_BODY"><CODE>READING_BODY</CODE></A>.
<DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE> - If the <code>SocketChannel</code> has been closed or discovers other I/O problems.</DL>
</DD>
</DL>
<HR>
<A NAME="startPutting(short)"><!-- --></A><H3>
startPutting</H3>
<PRE>
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</A> <B>startPutting</B>(short channelID)
throws <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></PRE>
<DL>
<DD>Returns a <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio"><CODE>ByteBuffer</CODE></A> that can be used for putting data.
<p>
Turns the <A HREF="../../../../org/eclipse/net4j/buffer/IBuffer.html#getState()"><CODE>state</CODE></A> of this buffer into <A HREF="../../../../org/eclipse/net4j/buffer/BufferState.html#PUTTING"><CODE>PUTTING</CODE></A>.
<p>
The returned <code>ByteBuffer</code> <b>may only</b> be used for putting data. It is left to the responsibility of
the caller that only the following methods of that <code>ByteBuffer</code> are used:
<ul>
<li> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true#put(byte)" title="class or interface in java.nio"><CODE>ByteBuffer.put(byte)</CODE></A>
<li> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true#put(byte[])" title="class or interface in java.nio"><CODE>ByteBuffer.put(byte[])</CODE></A>
<li> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true#put(java.nio.ByteBuffer)" title="class or interface in java.nio"><CODE>ByteBuffer.put(ByteBuffer)</CODE></A>
<li> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true#put(int, byte)" title="class or interface in java.nio"><CODE>ByteBuffer.put(int, byte)</CODE></A>
<li> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true#put(byte[], int, int)" title="class or interface in java.nio"><CODE>ByteBuffer.put(byte[], int, int)</CODE></A>
<li> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true#putChar(char)" title="class or interface in java.nio"><CODE>ByteBuffer.putChar(char)</CODE></A>
<li> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true#putChar(int, char)" title="class or interface in java.nio"><CODE>ByteBuffer.putChar(int, char)</CODE></A>
<li> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true#putDouble(double)" title="class or interface in java.nio"><CODE>ByteBuffer.putDouble(double)</CODE></A>
<li> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true#putDouble(int, double)" title="class or interface in java.nio"><CODE>ByteBuffer.putDouble(int, double)</CODE></A>
<li> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true#putFloat(float)" title="class or interface in java.nio"><CODE>ByteBuffer.putFloat(float)</CODE></A>
<li> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true#putFloat(int, float)" title="class or interface in java.nio"><CODE>ByteBuffer.putFloat(int, float)</CODE></A>
<li> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true#putInt(int)" title="class or interface in java.nio"><CODE>ByteBuffer.putInt(int)</CODE></A>
<li> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true#putInt(int, int)" title="class or interface in java.nio"><CODE>ByteBuffer.putInt(int, int)</CODE></A>
<li> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true#putLong(long)" title="class or interface in java.nio"><CODE>ByteBuffer.putLong(long)</CODE></A>
<li> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true#putLong(int, long)" title="class or interface in java.nio"><CODE>ByteBuffer.putLong(int, long)</CODE></A>
<li> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true#putShort(short)" title="class or interface in java.nio"><CODE>ByteBuffer.putShort(short)</CODE></A>
<li> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true#putShort(int, short)" title="class or interface in java.nio"><CODE>ByteBuffer.putShort(int, short)</CODE></A>
<li>all other methods that do not influence <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/Buffer.html?is-external=true#position()" title="class or interface in java.nio"><CODE>Buffer.position()</CODE></A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/Buffer.html?is-external=true#limit()" title="class or interface in java.nio"><CODE>Buffer.limit()</CODE></A> and
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/Buffer.html?is-external=true#capacity()" title="class or interface in java.nio"><CODE>Buffer.capacity()</CODE></A>
</ul>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>channelID</CODE> - The index of an <A HREF="../../../../org/eclipse/net4j/channel/IChannel.html" title="interface in org.eclipse.net4j.channel"><CODE>IChannel</CODE></A> that this buffer is intended to be passed to later or <A HREF="../../../../org/eclipse/net4j/buffer/IBuffer.html#NO_CHANNEL"><CODE>NO_CHANNEL</CODE></A>
.
<DT><B>Returns:</B><DD>A <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio"><CODE>ByteBuffer</CODE></A> that can be used for putting data.
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - If the state of this buffer is not <A HREF="../../../../org/eclipse/net4j/buffer/BufferState.html#INITIAL"><CODE>INITIAL</CODE></A> (<A HREF="../../../../org/eclipse/net4j/buffer/BufferState.html#PUTTING"><CODE>PUTTING</CODE></A> is allowed but meaningless if and only if the given <code>channelID</code> is equal to the
existing <code>channelID</code> of this buffer).</DL>
</DD>
</DL>
<HR>
<A NAME="write(java.nio.channels.SocketChannel)"><!-- --></A><H3>
write</H3>
<PRE>
boolean <B>write</B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/channels/SocketChannel.html?is-external=true" title="class or interface in java.nio.channels">SocketChannel</A> socketChannel)
throws <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A>,
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></PRE>
<DL>
<DD>Tries to write the data of this buffer to a <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/channels/SocketChannel.html?is-external=true" title="class or interface in java.nio.channels"><CODE>SocketChannel</CODE></A>.
<p>
This method is non-blocking and it can be necessary to repeatedly call it. If it was not possible to completely
write the data to the <code>SocketChannel</code> <code>false</code> is returned and the state of this buffer
remains <A HREF="../../../../org/eclipse/net4j/buffer/BufferState.html#WRITING"><CODE>WRITING</CODE></A>.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>socketChannel</CODE> - The <code>socketChannel</code> to write the data to.
<DT><B>Returns:</B><DD><code>true</code> if it was possible to completely write the data to the <code>SocketChannel</code>,
<code>false</code> otherwise.
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - If the state of this buffer is not <A HREF="../../../../org/eclipse/net4j/buffer/BufferState.html#PUTTING"><CODE>PUTTING</CODE></A> or <A HREF="../../../../org/eclipse/net4j/buffer/BufferState.html#WRITING"><CODE>WRITING</CODE></A>.
<DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE> - If the <code>SocketChannel</code> has been closed or discovers other I/O problems.</DL>
</DD>
</DL>
<HR>
<A NAME="flip()"><!-- --></A><H3>
flip</H3>
<PRE>
void <B>flip</B>()
throws <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></PRE>
<DL>
<DD>Turns the state of this buffer from <A HREF="../../../../org/eclipse/net4j/buffer/BufferState.html#PUTTING"><CODE>PUTTING</CODE></A> into <A HREF="../../../../org/eclipse/net4j/buffer/BufferState.html#GETTING"><CODE>GETTING</CODE></A>.
<P>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - If the state of this buffer is not <A HREF="../../../../org/eclipse/net4j/buffer/BufferState.html#PUTTING"><CODE>PUTTING</CODE></A>.</DL>
</DD>
</DL>
<HR>
<A NAME="getByteBuffer()"><!-- --></A><H3>
getByteBuffer</H3>
<PRE>
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</A> <B>getByteBuffer</B>()
throws <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></PRE>
<DL>
<DD>Returns the <code>ByteBuffer</code> that can be used for putting or getting data.
<P>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - If the state of this buffer is not <A HREF="../../../../org/eclipse/net4j/buffer/BufferState.html#PUTTING"><CODE>PUTTING</CODE></A> or <A HREF="../../../../org/eclipse/net4j/buffer/BufferState.html#GETTING"><CODE>GETTING</CODE></A>.</DL>
</DD>
</DL>
<HR>
<A NAME="isEOS()"><!-- --></A><H3>
isEOS</H3>
<PRE>
boolean <B>isEOS</B>()</PRE>
<DL>
<DD>Returns the <em>End Of Stream</em> flag to indicate whether this buffer is the last buffer in a stream of buffers.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setEOS(boolean)"><!-- --></A><H3>
setEOS</H3>
<PRE>
void <B>setEOS</B>(boolean eos)</PRE>
<DL>
<DD>Sets the <em>End Of Stream</em> flag to indicate whether this buffer is the last buffer in a stream of buffers.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="release()"><!-- --></A><H3>
release</H3>
<PRE>
void <B>release</B>()</PRE>
<DL>
<DD>Releases this buffer to its original <A HREF="../../../../org/eclipse/net4j/buffer/IBufferProvider.html" title="interface in org.eclipse.net4j.buffer"><CODE>IBufferProvider</CODE></A>.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="clear()"><!-- --></A><H3>
clear</H3>
<PRE>
void <B>clear</B>()</PRE>
<DL>
<DD>Turns the state of this buffer from any state into <A HREF="../../../../org/eclipse/net4j/buffer/BufferState.html#INITIAL"><CODE>INITIAL</CODE></A>.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="formatContent(boolean)"><!-- --></A><H3>
formatContent</H3>
<PRE>
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>formatContent</B>(boolean showHeader)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getErrorHandler()"><!-- --></A><H3>
getErrorHandler</H3>
<PRE>
<A HREF="../../../../org/eclipse/net4j/util/IErrorHandler.html" title="interface in org.eclipse.net4j.util">IErrorHandler</A> <B>getErrorHandler</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Since:</B></DT>
<DD>2.0</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="setErrorHandler(org.eclipse.net4j.util.IErrorHandler)"><!-- --></A><H3>
setErrorHandler</H3>
<PRE>
void <B>setErrorHandler</B>(<A HREF="../../../../org/eclipse/net4j/util/IErrorHandler.html" title="interface in org.eclipse.net4j.util">IErrorHandler</A> errorHandler)</PRE>
<DL>
<DD><DL>
<DT><B>Since:</B></DT>
<DD>2.0</DD>
</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/IBuffer.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>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../org/eclipse/net4j/buffer/BufferState.html" title="enum in org.eclipse.net4j.buffer"><B>PREV CLASS</B></A>
<A HREF="../../../../org/eclipse/net4j/buffer/IBufferHandler.html" title="interface in org.eclipse.net4j.buffer"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?org/eclipse/net4j/buffer/IBuffer.html" target="_top"><B>FRAMES</B></A>
<A HREF="IBuffer.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="#field_summary">FIELD</A> | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
<i>Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.</i>
</BODY>
</HTML>