[Python-checkins] r46435 - in sandbox/trunk/hotbuffer: README.txt ref ref/Buffer.html ref/ByteBuffer.html test_hotbuf.py use_cases.py

martin.blais python-checkins at python.org
Sat May 27 11:58:14 CEST 2006


Author: martin.blais
Date: Sat May 27 11:58:13 2006
New Revision: 46435

Added:
   sandbox/trunk/hotbuffer/ref/
   sandbox/trunk/hotbuffer/ref/Buffer.html   (contents, props changed)
   sandbox/trunk/hotbuffer/ref/ByteBuffer.html   (contents, props changed)
Removed:
   sandbox/trunk/hotbuffer/use_cases.py
Modified:
   sandbox/trunk/hotbuffer/README.txt
   sandbox/trunk/hotbuffer/test_hotbuf.py
Log:
Use cases added to test file

Modified: sandbox/trunk/hotbuffer/README.txt
==============================================================================
--- sandbox/trunk/hotbuffer/README.txt	(original)
+++ sandbox/trunk/hotbuffer/README.txt	Sat May 27 11:58:13 2006
@@ -13,57 +13,49 @@
 .. contents::
 ..
     1  TODO
-      1.1  Features
+      1.1  Other Features
       1.2  Ideas
-      1.3  Document
-      1.4  Convert from ASCII formats
-    2  Notes on the Java NIO / ByteBuffer
+      1.3  Documentation
 
 
 TODO
 ====
 
-* Remove the advbytes argument to pop()
+* Remove the advbytes argument to pop(), it is confusing.
 
-* Make push() and pop() instead of save() and restore(), use a C stack
-  internally.
+* Remove the mark, save() and restore().
 
 * Make it possible to read from a file directly into a hotbuf
 
   - implement the file protocol (read(), write()) on the hotbuf object
   - is there a file protocol?
 
-* We need to select between PyObject_MALLOC and PyObject_MEMMALLOC
-
+* Implement relative get/put methods that don't increment the position.
 
+* Implement absolute get/put methods.
 
-Features
---------
-
-* Use descriptors rather than function calls to set the limit, etc.
+* We need to select between PyObject_MALLOC and PyObject_MEMMALLOC
 
 * Implement pack() in C
 
-* Change the mark, this will make the loop easier to understand
+* Add support for some of the other sequence methods.
 
-  * setmark() to save both the position and limit
-  * remove the special behaviours of the mark being discarded
-  * reset() should reset both the position and the limit
-  * setmark() becomes push(), reset() becomes pop()
+* Add methods to parse ints, longs, floats and doubles directly from the buffer
+  contents, without using a temporary string.
 
-- Add hash function
+* Write a small PEP about this, when all is said and done.
 
-- Add support for some of the other sequence methods.
+Other Features
+--------------
 
-- Perhaps implement returning the buffer object itself from some of
+- Consider the implications of adding a hash function
 
-  the methods in order to allow chaining of operations on a single line.
-
-- Implement a resize function
+- Maybe implement a resize function
 
 - Should we support weakrefs?
 
-* Add with protocol for guards
+- Add with protocol for guards
+
 
 Ideas
 -----
@@ -77,28 +69,3 @@
   process for each message.
 
 
-   
-Document
---------
-
-* Write a smallish PEP about it
-
-* Remove Py_XDECREF where possible
-
-Convert from ASCII formats
---------------------------
-
-* We need to be able to convert from ascii formats, e.g. long with an offset
-  (Runar, the long conversions)
-
-
-
-Notes on the Java NIO / ByteBuffer
-==================================
-
-Inspired from the interaction of:
-
-* Java ByteBuffer class
-* SocketChannel
-* NIO classes
-

Added: sandbox/trunk/hotbuffer/ref/Buffer.html
==============================================================================
--- (empty file)
+++ sandbox/trunk/hotbuffer/ref/Buffer.html	Sat May 27 11:58:13 2006
@@ -0,0 +1,295 @@
+
+
+
+
+
+
+
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<title>Sun Microsystems</title>
+<!-- BEGIN METADATA -->
+<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
+<meta name="published_date" content="2003-05-14">
+<meta name="content_type" content="Hub Page">
+<meta name="archive" content="false">
+<meta name="description" content="">
+<link rel="stylesheet" href="/css/default_developer.css" />
+<link rel="stylesheet" href="/css/default.css" />
+<link rel="stylesheet" href="/css/homepage.css" />
+
+<script language="JavaScript" type="text/javascript" src="/js/popUp.js"></script>
+<script language="javascript1.2" type="text/javascript" src="/js/sniff.js"></script>
+<script language="javascript1.2" type="text/javascript" src="/js/menucontent.js"></script>
+<script language="javascript1.2" type="text/javascript" src="/js/menucode.js"></script>
+<script language="JavaScript"><!-- var s_pageName="home page" //--></script>
+<!-- END METADATA -->
+</head>
+<!--stopindex-->
+<body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" rightmargin="0" bgcolor="#ffffff" onload="prepmenus(); done=true">
+
+<a name="top"></a>
+	
+<!-- BEGIN A1 COMPONENT V.0 -->
+
+<div class="a1">
+<div class="a1v0">
+<table cellpadding="0" cellspacing="0" border="0" width="100%">
+<tr valign="bottom">
+<td nowrap="nowrap">
+<a href="#skip2content"><img src="/im/a.gif" alt="Skip to Content" width="1" height="1" border="0"></a>
+<span class="toolbarlinks">
+<a href="/global/mh/java/">Java</a>
+<a href="/global/mh/solaris/" class="dividelink">Solaris</a>
+<a href="/global/mh/communities/">Communities</a>
+
+<a href="/global/mh/store/" class="lastlink">Sun Store</a>
+</span>
+</td><td align="right" nowrap="nowrap">
+<span class="toolbarlinks">
+<a href="http://developers.sun.com/global/join_sdn.html"><b>Join SDN</b></a>
+<a href="http://developers.sun.com/global/my_profile.html">My Profile</a>
+<a href="http://developers.sun.com/global/why_join.html" class="lastlink">Why Join?</a>
+</span>
+</td></tr>
+</table>
+</div>
+</div>
+
+<!-- END A1 COMPONENT V.0 -->
+
+<!-- BEGIN VNV1 COMPONENT V0  -->
+<script type='text/JavaScript' src='/js/showHide.js'></script>
+<div class="vnv1" id="vnv1v0">
+<div class="cornerTL"><div class="cornerTR"><div class="cornerBL"><div class="cornerBR">
+
+<div class="vnv1search">
+	<table border="0" cellpadding="0" cellspacing="0" class="topnavlight">
+	<form action="http://developers.sun.com/search/onesearch/index.jsp" accept-charset="utf-8" method="GET">
+	<input type="hidden" name="charset" value="utf-8">
+	<input type="hidden" name="col" value="dev-reference">
+
+	<tr>
+	<td nowrap="nowrap"><span class="rightarrowwhite">&raquo;</span>&nbsp;<a href="http://developers.sun.com/global/search_tips.html">search tips</a>&nbsp;</td>
+	<td><input class="searchfield" name="qt" class="medium" size="7" onFocus="if( this.value==this.defaultValue ) this.value='';" value="Search"></td>
+	<td valign="middle" align="left"><input type="image" border="0" src="/im/vnv1_bttn_search.gif" alt="Submit Search"></td>
+
+	</tr></form>
+	</table>
+</div>
+
+<div class="vnv1topiclinks">
+
+<table cellpadding="1" cellspacing="0" border="0">
+<tr>
+<td rowspan="2"><a href="http://java.sun.com" title="java.sun.com"><img src="/im/a.gif" alt="Home Page" width="96" height="58" border="0" class="sunlogo"></a></td>
+<td colspan="12"><a href="http://developers.sun.com" title="developers.sun.com"><img src="/im/a.gif" alt="" width="250" height="32" border="0"></a></td>
+</tr>
+<tr valign="bottom">
+<td><img src="/im/a.gif" alt="" width="1" height="1" border="0" id="ip1"></td>
+<td class="navlinks" id="navlink1" onMouseOver="javascript:popfly(1);" onMouseOut="javascript:closefly();"><div onMouseOver="javascript:popfly(1);" onMouseOut="javascript:closefly();"><a id="glink1" onclick="if(window.s_account&&this.getAttribute('title')){s_linkType='o';s_linkName='Masthead Menu: '+this.getAttribute('title');s_prop15=s_pageName;s_prop16=this.getAttribute('title');s_lnk=s_co(this);s_gs(s_account);}" href="/global/mh/api/index.html" title="See All APIs">APIs</a></div></td>
+<td><img src="/im/a.gif" alt="" width="1" height="1" border="0" id="ip2"></td>
+<td class="navlinks" id="navlink2" onMouseOver="javascript:popfly(2);" onMouseOut="javascript:closefly();"><div onMouseOver="javascript:popfly(2);" onMouseOut="javascript:closefly();"><a id="glink2" onclick="if(window.s_account&&this.getAttribute('title')){s_linkType='o';s_linkName='Masthead Menu: '+this.getAttribute('title');s_prop15=s_pageName;s_prop16=this.getAttribute('title');s_lnk=s_co(this);s_gs(s_account);}" href="/global/mh/downloads/index.html" title="See All Downloads">Downloads</a></div></td>
+<td><img src="/im/a.gif" alt="" width="1" height="1" border="0" id="ip3"></td>
+<td class="navlinks" id="navlink3" onMouseOver="javascript:popfly(3);" onMouseOut="javascript:closefly();"><div onMouseOver="javascript:popfly(3);" onMouseOut="javascript:closefly();"><a id="glink3" onclick="if(window.s_account&&this.getAttribute('title')){s_linkType='o';s_linkName='Masthead Menu: '+this.getAttribute('title');s_prop15=s_pageName;s_prop16=this.getAttribute('title');s_lnk=s_co(this);s_gs(s_account);}" href="/global/mh/tech/index.html" title="See All Technologies">Technologies</a></div></td>
+
+<td><img src="/im/a.gif" alt="" width="1" height="1" border="0" id="ip4"></td>
+
+<td class="navlinks" id="navlink4" onMouseOver="javascript:popfly(4);" onMouseOut="javascript:closefly();"><div onMouseOver="javascript:popfly(4);" onMouseOut="javascript:closefly();"><a id="glink4" onclick="if(window.s_account&&this.getAttribute('title')){s_linkType='o';s_linkName='Masthead Menu: '+this.getAttribute('title');s_prop15=s_pageName;s_prop16=this.getAttribute('title');s_lnk=s_co(this);s_gs(s_account);}" href="/global/mh/products/index.html" title="See All Products">Products</a></div></td>
+<td><img src="/im/a.gif" alt="" width="1" height="1" border="0" id="ip5"></td>
+<td class="navlinks" id="navlink5" onMouseOver="javascript:popfly(5);" onMouseOut="javascript:closefly();"><div onMouseOver="javascript:popfly(5);" onMouseOut="javascript:closefly();"><a id="glink5" onclick="if(window.s_account&&this.getAttribute('title')){s_linkType='o';s_linkName='Masthead Menu: '+this.getAttribute('title');s_prop15=s_pageName;s_prop16=this.getAttribute('title');s_lnk=s_co(this);s_gs(s_account);}" href="/global/mh/support/index.html" title="See All Support">Support</a></div></td>
+<td><img src="/im/a.gif" alt="" width="1" height="1" border="0" id="ip6"></td>
+<td class="navlinks" id="navlink6" onMouseOver="javascript:popfly(6);" onMouseOut="javascript:closefly();"><div onMouseOver="javascript:popfly(6);" onMouseOut="javascript:closefly();"><a id="glink6" onclick="if(window.s_account&&this.getAttribute('title')){s_linkType='o';s_linkName='Masthead Menu: '+this.getAttribute('title');s_prop15=s_pageName;s_prop16=this.getAttribute('title');s_lnk=s_co(this);s_gs(s_account);}" href="/global/mh/suncom/index.html" title="See All Sun.com">Sun.com</a></div></td>
+</tr>
+</table>
+</div>
+
+</div></div></div></div>
+</div>
+
+<script type="text/javascript"> printmenus(); </script>
+
+<!-- END VNV1 COMPONENT V0  -->
+
+
+<!-- BEGIN BREADCRUMB -->
+<table border="0" cellpadding="0" cellspacing="0" width="100%" class="vatop">
+<tr>
+<td>      
+<div class="breadcrumb">
+<a href="http://developers.sun.com/index.html">Developers Home</a> &gt;
+</div>
+</td>
+<td align="right" nowrap="nowrap"><div class="breadcrumb">
+</div></td></tr>
+<tr><td colspan="2"><img src="/im/a.gif" width="770" height="1" border="0" alt=" " /></td></tr>
+</table>
+<span class="sp5">&nbsp;</span><br />
+<!-- END BREADCRUMB -->
+	
+<!-- BEGIN VNV3 PAGETITLE -->
+<div class="pagetitle">Page Not Found&nbsp;</div>
+<!-- END VNV3 PAGETITLE -->
+
+<!-- BEGIN WRAPPER TABLE, 1 COLUMN, MAIN -->
+<table border="0" cellpadding="10" cellspacing="0" width="100%">
+<tr><td width="100%" valign="top">
+<!-- BEGIN CENTRAL COLUMN COMPONENTS -->
+
+<!--startindex-->
+
+<!-- ============ -->
+<!-- MAIN CONTENT -->
+<!-- ============ -->
+<!-- BEGIN VCD1 OVERVIEW COMPONENT  -->
+<div class="padbottom10">We are sorry, the page you have requested was not found on our system. Based
+upon the url that you requested, we would like to recommend pages that match your requested url. 
+If you prefer, you may <a href="/">navigate through our site</a> or use our <a href="#search">search</a> for your page.<br />
+<br />
+<p>If you are certain that this URL is valid, please send us
+<b><a href="/contact/feedback.jsp?
+referer=http://java.sun.com/notfound.jsp
+&requrl=http://java.sun.com/j2se/1.5.0/docs/api/java/nio/Buffer.html#reset()
+&refurl=http://java.sun.com/UserTypedUrl
+&category=se">feedback</a></b>
+about the broken link.
+</div>
+<div class="contentdivider"><table border="0" cellpadding="0" cellspacing="0" width="100%" class="grey4">
+<tr><td><img src="/im/a.gif" width="1" height="4" border="0" alt=" " /></td></tr></table></div>
+<!-- END VCD1 OVERVIEW COMPONENT  -->
+
+<!-- BEGIN VCD3 TITLED SECTION COMPONENT  -->
+<div class="pad6">
+<b>Your URL: </b>&nbsp;&nbsp;http://java.sun.com/j2se/1.5.0/docs/api/java/nio/Buffer.html#reset()
+<br /><br />
+<b>Recommended URLs to try:</b><br />
+</div>
+<table border="0" cellpadding="0" cellspacing="0" width="100%" class="grey4"><tr><td><img src="/im/a.gif" width="1" height="1" border="0" alt=" " /></td></tr></table>
+<div class="pad6">
+	
+<b><a href="/index.jsp">Java Technology</b></a> <br>
+The home of Java Products & Technologies<br>
+<a href="/index.jsp">http://java.sun.com/index.jsp</a><br><br>
+
+<table border="0" cellpadding="0" cellspacing="0" width="100%" class="grey4"><tr><td><img src="/im/a.gif" width="1" height="1" border="0" alt=" " /></td></tr></table>
+	
+<b><a href="/reference/api/index.html">API</b></a> <br>
+Java API Index<br>
+<a href="/reference/api/index.html">http://java.sun.com/reference/api/index.html</a><br><br>
+
+<table border="0" cellpadding="0" cellspacing="0" width="100%" class="grey4"><tr><td><img src="/im/a.gif" width="1" height="1" border="0" alt=" " /></td></tr></table>
+	
+<b><a href="/reference/docs/index.html">Documentation</b></a> <br>
+Reference Documentaion<br>
+<a href="/reference/docs/index.html">http://java.sun.com/reference/docs/index.html</a><br><br>
+
+<table border="0" cellpadding="0" cellspacing="0" width="100%" class="grey4"><tr><td><img src="/im/a.gif" width="1" height="1" border="0" alt=" " /></td></tr></table>
+	
+<b><a href="/j2se/index.jsp">J2SE</b></a> <br>
+Java 2 Platform, Standard Edition (J2SE) provides a complete environment for applications development on desktops and servers.<br>
+<a href="/j2se/index.jsp">http://java.sun.com/j2se/index.jsp</a><br><br>
+
+<table border="0" cellpadding="0" cellspacing="0" width="100%" class="grey4"><tr><td><img src="/im/a.gif" width="1" height="1" border="0" alt=" " /></td></tr></table>
+ 
+</div>
+<span class="sp10">&nbsp;</span><br />
+<!-- END VCD3 TITLED SECTION COMPONENT  -->
+
+<a name="search"></a>
+<div class="contentdivider"><table border="0" cellpadding="0" cellspacing="0" width="100%" class="grey4">
+<tr><td><img src="/im/a.gif" width="1" height="4" border="0" alt=" " /></td></tr></table></div>
+<!-- <form name="notfoundsearch" method ="post" action="http://developer.sun.com/dispatcher.jsp">
+<input type="hidden" name="uid" value="6910018"/> -->
+<form action="/search/onesearch/index.jsp" accept-charset="utf-8" method="GET">
+<input type="hidden" name="charset" value="utf-8">
+<input type="hidden" name="col" value="dev-reference">
+</div>
+<!-- END VCD1 OVERVIEW COMPONENT  -->
+<!-- BEGIN VCD3 TITLED SECTION COMPONENT  -->
+<div><b>Search for your page</b><br />
+If you prefer, we have suggested words that you may wish use to search our site.<br /><br /></div>
+
+<div class="pad6">
+<b>URL Requested: </b>&nbsp;&nbsp;http://java.sun.com/j2se/1.5.0/docs/api/java/nio/Buffer.html#reset()<br />
+<span class="sp10">&nbsp;</span><br />
+<input type="text" name="qt" class="large" size="30" value="j2se 1.5.0 docs api java nio Buffer.html#reset() " />
+<input type="submit" border="0" class="buttonblue2" value="&nbsp;&raquo;&nbsp;Search" onmouseover="this.style.color='#fbe249';" onmouseout="this.style.color='#FFF';" />
+</div>
+<span class="sp10">&nbsp;</span><br />
+<!-- END VCD3 TITLED SECTION COMPONENT  -->
+</form>
+<!-- =================== -->
+<!-- END OF MAIN CONTENT -->
+<!-- =================== -->
+
+<!--stopindex-->
+
+<!-- END CENTRAL COLUMN COMPONENTS -->
+</td></tr>
+<!-- BEGIN SPACER ROW -->
+<tr><td><img src="/im/a.gif" width="750" height="1" border="0" alt=" " /></td></tr>
+<!-- END SPACER ROW -->
+</table>
+<!-- END WRAPPER TABLE, 1 COLUMN, MAIN -->
+<!-- Begin SiteCatalyst code version: G.5. -->
+<script language="JavaScript">
+<!--
+var s_pageName="/notfound.jsp?Recommend"
+//-->
+</script>
+<!-- End SiteCatalyst code version: G.5. -->
+
+<!-- BEGIN VNV5 FOOTER  -->
+<table border="0" cellpadding="0" cellspacing="10" width="100%">
+<tr>
+<td>
+<table border="0" cellpadding="0" cellspacing="0" width="100%" class="vatop">
+<tr>
+<td colspan="4" valign="top" class="grey3"><img src="http://developers.sun.com/im/a.gif" width="1" height="2" border="0" alt=" " /></td></tr>
+<tr>
+
+<td><img src="http://developers.sun.com/im/a.gif" width="190" height="1" border="0" alt=" " /><br />
+<a href="http://www.sun.com"><img src="http://developers.sun.com/im/logo_sun_small_sdn.gif" width="61" height="29" border="0" alt=" " vspace="5"/></a></td>
+<td width="100%" valign="top"><img src="http://developers.sun.com/im/a.gif" width="350" height="1" border="0" alt=" " /><br />
+<div class="footer">
+<a href="http://developers.sun.com/global/aboutsun.html">About Sun</a> &nbsp;|&nbsp;
+<a href="http://developers.sun.com/global/aboutsdn.html">About This Site</a> &nbsp;|&nbsp;
+<a href="http://developers.sun.com/global/newsletters.html">Newsletters</a> &nbsp;|&nbsp;
+
+<a href="/contact/index.jsp?
+referer=http://java.sun.com/notfound.jsp
+&requrl=http://java.sun.com/j2se/1.5.0/docs/api/java/nio/Buffer.html#reset()
+&refurl=http://java.sun.com/UserTypedUrl
+">Contact Us</a> &nbsp;|&nbsp;
+
+<a href="http://developers.sun.com/global/employment.html">Employment</a><br />
+<a href="http://developers.sun.com/global/howtobuy.html">How to Buy</a> &nbsp;|&nbsp;
+<a href="http://developers.sun.com/global/licensing.html">Licensing</a> &nbsp;|&nbsp;
+<a href="http://developers.sun.com/global/termsofuse.html">Terms of Use</a> &nbsp;|&nbsp;
+<a href="http://developers.sun.com/global/privacy.html">Privacy</a> &nbsp;|&nbsp;
+<a href="http://developers.sun.com/global/trademarks.html">Trademarks</a>
+<br /><span class="sp10">&nbsp;</span><br />
+<br /><span class="sp10">&nbsp;</span><br />
+Copyright 1994-2005 Sun Microsystems, Inc.
+</div></td>
+<td><img src="http://developers.sun.com/im/a.gif" width="40" height="1" border="0" alt=" " /></td>
+<td valign="top"><div class="footer"><b><a href="http://developers.sun.com/global/aboutsdn.html">A Sun Developer Network Site</a></b></div>
+<div class="footer">
+<img src="http://developers.sun.com/im/a.gif" width="170" height="1" border="0" alt=" " /><br />
+Unless otherwise licensed, code in all technical manuals herein (including articles, FAQs, samples) is provided under this <a href="http://developers.sun.com/global/berkeley_license.html">License</a>.
+<br /><span class="sp5">&nbsp;</span><br />
+<a href="http://developers.sun.com/global/rss_sdn.html"><img src="http://developers.sun.com/im/button_xml.gif" width="36" height="14" align="top" border="0" alt="XML" /></a>&nbsp;<a href="http://developers.sun.com/global/content_feeds.html">Content Feeds</a>
+
+</div></td></tr>
+<tr><td colspan="4" valign="top" class="grey3"><img src="http://developers.sun.com/im/a.gif" width="1" height="2" border="0" alt=" " /></td></tr>
+</table>
+</td></tr>
+</table>
+<!-- END VNV5 FOOTER -->
+</body>
+<script language="JavaScript" src="/js/omi/jsc/s_code_remote.js"></script></html>
+
+		
+

Added: sandbox/trunk/hotbuffer/ref/ByteBuffer.html
==============================================================================
--- (empty file)
+++ sandbox/trunk/hotbuffer/ref/ByteBuffer.html	Sat May 27 11:58:13 2006
@@ -0,0 +1,2477 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!--NewPage-->
+<HTML>
+<HEAD>
+<meta name="collection" content="api">
+<!-- Generated by javadoc (build 1.5.0-rc) on Wed Aug 11 07:23:00 PDT 2004 -->
+<TITLE>
+ByteBuffer (Java 2 Platform SE 5.0)
+</TITLE>
+
+<META NAME="keywords" CONTENT="java.nio.ByteBuffer class">
+<META NAME="keywords" CONTENT="allocateDirect()">
+<META NAME="keywords" CONTENT="allocate()">
+<META NAME="keywords" CONTENT="wrap()">
+<META NAME="keywords" CONTENT="slice()">
+<META NAME="keywords" CONTENT="duplicate()">
+<META NAME="keywords" CONTENT="asReadOnlyBuffer()">
+<META NAME="keywords" CONTENT="get()">
+<META NAME="keywords" CONTENT="put()">
+<META NAME="keywords" CONTENT="hasArray()">
+<META NAME="keywords" CONTENT="array()">
+<META NAME="keywords" CONTENT="arrayOffset()">
+<META NAME="keywords" CONTENT="compact()">
+<META NAME="keywords" CONTENT="isDirect()">
+<META NAME="keywords" CONTENT="toString()">
+<META NAME="keywords" CONTENT="hashCode()">
+<META NAME="keywords" CONTENT="equals()">
+<META NAME="keywords" CONTENT="compareTo()">
+<META NAME="keywords" CONTENT="order()">
+<META NAME="keywords" CONTENT="getChar()">
+<META NAME="keywords" CONTENT="putChar()">
+<META NAME="keywords" CONTENT="asCharBuffer()">
+<META NAME="keywords" CONTENT="getShort()">
+<META NAME="keywords" CONTENT="putShort()">
+<META NAME="keywords" CONTENT="asShortBuffer()">
+<META NAME="keywords" CONTENT="getInt()">
+<META NAME="keywords" CONTENT="putInt()">
+<META NAME="keywords" CONTENT="asIntBuffer()">
+<META NAME="keywords" CONTENT="getLong()">
+<META NAME="keywords" CONTENT="putLong()">
+<META NAME="keywords" CONTENT="asLongBuffer()">
+<META NAME="keywords" CONTENT="getFloat()">
+<META NAME="keywords" CONTENT="putFloat()">
+<META NAME="keywords" CONTENT="asFloatBuffer()">
+<META NAME="keywords" CONTENT="getDouble()">
+<META NAME="keywords" CONTENT="putDouble()">
+<META NAME="keywords" CONTENT="asDoubleBuffer()">
+
+<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
+
+<SCRIPT type="text/javascript">
+function windowTitle()
+{
+    parent.document.title="ByteBuffer (Java 2 Platform SE 5.0)";
+}
+</SCRIPT>
+<NOSCRIPT>
+</NOSCRIPT>
+
+</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=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>&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/ByteBuffer.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-files/index-1.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>
+<b>Java<sup><font size=-2>TM</font></sup>&nbsp;2&nbsp;Platform<br>Standard&nbsp;Ed. 5.0</b></EM>
+</TD>
+</TR>
+
+<TR>
+<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
+&nbsp;<A HREF="../../java/nio/BufferUnderflowException.html" title="class in java.nio"><B>PREV CLASS</B></A>&nbsp;
+&nbsp;<A HREF="../../java/nio/ByteOrder.html" title="class in java.nio"><B>NEXT CLASS</B></A></FONT></TD>
+<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
+  <A HREF="../../index.html?java/nio/ByteBuffer.html" target="_top"><B>FRAMES</B></A>  &nbsp;
+&nbsp;<A HREF="ByteBuffer.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;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
+<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
+DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&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.nio</FONT>
+<BR>
+Class ByteBuffer</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/nio/Buffer.html" title="class in java.nio">java.nio.Buffer</A>
+      <IMG SRC="../../resources/inherit.gif" ALT="extended by "><B>java.nio.ByteBuffer</B>
+</PRE>
+<DL>
+<DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../java/lang/Comparable.html" title="interface in java.lang">Comparable</A>&lt;<A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A>&gt;</DD>
+</DL>
+<DL>
+<DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../java/nio/MappedByteBuffer.html" title="class in java.nio">MappedByteBuffer</A></DD>
+</DL>
+<HR>
+<DL>
+<DT><PRE>public abstract class <B>ByteBuffer</B><DT>extends <A HREF="../../java/nio/Buffer.html" title="class in java.nio">Buffer</A><DT>implements <A HREF="../../java/lang/Comparable.html" title="interface in java.lang">Comparable</A>&lt;<A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A>&gt;</DL>
+</PRE>
+
+<P>
+A byte buffer.
+
+ <p> This class defines six categories of operations upon
+ byte buffers:
+
+ <ul>
+
+   <li><p> Absolute and relative <A HREF="../../java/nio/ByteBuffer.html#get()"><CODE></code><i>get</i><code></CODE></A> and
+   <A HREF="../../java/nio/ByteBuffer.html#put(byte)"><CODE></code><i>put</i><code></CODE></A> methods that read and write
+   single bytes; </p></li>
+
+   <li><p> Relative <A HREF="../../java/nio/ByteBuffer.html#get(byte[])"><CODE></code><i>bulk get</i><code></CODE></A>
+   methods that transfer contiguous sequences of bytes from this buffer
+   into an array; </p></li>
+
+   <li><p> Relative <A HREF="../../java/nio/ByteBuffer.html#put(byte[])"><CODE></code><i>bulk put</i><code></CODE></A>
+   methods that transfer contiguous sequences of bytes from a
+   byte array or some other byte
+   buffer into this buffer; </p></li>
+
+
+
+   <li><p> Absolute and relative <A HREF="../../java/nio/ByteBuffer.html#getChar()"><CODE></code><i>get</i><code></CODE></A>
+   and <A HREF="../../java/nio/ByteBuffer.html#putChar(char)"><CODE></code><i>put</i><code></CODE></A> methods that read and
+   write values of other primitive types, translating them to and from
+   sequences of bytes in a particular byte order; </p></li>
+
+   <li><p> Methods for creating <i><a href="#views">view buffers</a></i>,
+   which allow a byte buffer to be viewed as a buffer containing values of
+   some other primitive type; and </p></li>
+
+
+
+   <li><p> Methods for <A HREF="../../java/nio/ByteBuffer.html#compact()"><CODE></code>compacting<code></CODE></A>, <A HREF="../../java/nio/ByteBuffer.html#duplicate()"><CODE></code>duplicating<code></CODE></A>, and <A HREF="../../java/nio/ByteBuffer.html#slice()"><CODE></code>slicing<code></CODE></A> a byte buffer.  </p></li>
+
+ </ul>
+
+ <p> Byte buffers can be created either by <A HREF="../../java/nio/ByteBuffer.html#allocate(int)"><CODE></code><i>allocation</i><code></CODE></A>, which allocates space for the buffer's
+
+
+
+ content, or by <A HREF="../../java/nio/ByteBuffer.html#wrap(byte[])"><CODE></code><i>wrapping</i><code></CODE></A> an
+ existing byte array  into a buffer.
+
+
+
+
+
+
+
+
+
+
+
+ <a name="direct">
+ <h4> Direct <i>vs.</i> non-direct buffers </h4>
+
+ <p> A byte buffer is either <i>direct</i> or <i>non-direct</i>.  Given a
+ direct byte buffer, the Java virtual machine will make a best effort to
+ perform native I/O operations directly upon it.  That is, it will attempt to
+ avoid copying the buffer's content to (or from) an intermediate buffer
+ before (or after) each invocation of one of the underlying operating
+ system's native I/O operations.
+
+ <p> A direct byte buffer may be created by invoking the <A HREF="../../java/nio/ByteBuffer.html#allocateDirect(int)"><CODE>allocateDirect</CODE></A> factory method of this class.  The
+ buffers returned by this method typically have somewhat higher allocation
+ and deallocation costs than non-direct buffers.  The contents of direct
+ buffers may reside outside of the normal garbage-collected heap, and so
+ their impact upon the memory footprint of an application might not be
+ obvious.  It is therefore recommended that direct buffers be allocated
+ primarily for large, long-lived buffers that are subject to the underlying
+ system's native I/O operations.  In general it is best to allocate direct
+ buffers only when they yield a measureable gain in program performance.
+
+ <p> A direct byte buffer may also be created by <A HREF="../../java/nio/channels/FileChannel.html#map(java.nio.channels.FileChannel.MapMode, long, long)"><CODE></code>mapping<code></CODE></A> a region of a file
+ directly into memory.  An implementation of the Java platform may optionally
+ support the creation of direct byte buffers from native code via JNI.  If an
+ instance of one of these kinds of buffers refers to an inaccessible region
+ of memory then an attempt to access that region will not change the buffer's
+ content and will cause an unspecified exception to be thrown either at the
+ time of the access or at some later time.
+
+ <p> Whether a byte buffer is direct or non-direct may be determined by
+ invoking its <A HREF="../../java/nio/ByteBuffer.html#isDirect()"><CODE>isDirect</CODE></A> method.  This method is provided so
+ that explicit buffer management can be done in performance-critical code.
+
+
+ <a name="bin">
+ <h4> Access to binary data </h4>
+
+ <p> This class defines methods for reading and writing values of all other
+ primitive types, except <tt>boolean</tt>.  Primitive values are translated
+ to (or from) sequences of bytes according to the buffer's current byte
+ order, which may be retrieved and modified via the <A HREF="../../java/nio/ByteBuffer.html#order()"><CODE>order</CODE></A>
+ methods.  Specific byte orders are represented by instances of the <A HREF="../../java/nio/ByteOrder.html" title="class in java.nio"><CODE>ByteOrder</CODE></A> class.  The initial order of a byte buffer is always <A HREF="../../java/nio/ByteOrder.html#BIG_ENDIAN"><CODE>BIG_ENDIAN</CODE></A>.
+
+ <p> For access to heterogeneous binary data, that is, sequences of values of
+ different types, this class defines a family of absolute and relative
+ <i>get</i> and <i>put</i> methods for each type.  For 32-bit floating-point
+ values, for example, this class defines:
+
+ <blockquote><pre>
+ float  <A HREF="../../java/nio/ByteBuffer.html#getFloat()"><CODE>getFloat()</CODE></A>
+ float  <A HREF="../../java/nio/ByteBuffer.html#getFloat(int)"><CODE>getFloat(int index)</CODE></A>
+  void  <A HREF="../../java/nio/ByteBuffer.html#putFloat(float)"><CODE>putFloat(float f)</CODE></A>
+  void  <A HREF="../../java/nio/ByteBuffer.html#putFloat(int, float)"><CODE>putFloat(int index, float f)</CODE></A></pre></blockquote>
+
+ <p> Corresponding methods are defined for the types <tt>char</tt>,
+ <tt>short</tt>, <tt>int</tt>, <tt>long</tt>, and <tt>double</tt>.  The index
+ parameters of the absolute <i>get</i> and <i>put</i> methods are in terms of
+ bytes rather than of the type being read or written.
+
+ <a name="views">
+
+ <p> For access to homogeneous binary data, that is, sequences of values of
+ the same type, this class defines methods that can create <i>views</i> of a
+ given byte buffer.  A <i>view buffer</i> is simply another buffer whose
+ content is backed by the byte buffer.  Changes to the byte buffer's content
+ will be visible in the view buffer, and vice versa; the two buffers'
+ position, limit, and mark values are independent.  The <A HREF="../../java/nio/ByteBuffer.html#asFloatBuffer()"><CODE>asFloatBuffer</CODE></A> method, for example, creates an instance of
+ the <A HREF="../../java/nio/FloatBuffer.html" title="class in java.nio"><CODE>FloatBuffer</CODE></A> class that is backed by the byte buffer upon which
+ the method is invoked.  Corresponding view-creation methods are defined for
+ the types <tt>char</tt>, <tt>short</tt>, <tt>int</tt>, <tt>long</tt>, and
+ <tt>double</tt>.
+
+ <p> View buffers have three important advantages over the families of
+ type-specific <i>get</i> and <i>put</i> methods described above:
+
+ <ul>
+
+   <li><p> A view buffer is indexed not in terms of bytes but rather in terms
+   of the type-specific size of its values;  </p></li>
+
+   <li><p> A view buffer provides relative bulk <i>get</i> and <i>put</i>
+   methods that can transfer contiguous sequences of values between a buffer
+   and an array or some other buffer of the same type; and  </p></li>
+
+   <li><p> A view buffer is potentially much more efficient because it will
+   be direct if, and only if, its backing byte buffer is direct.  </p></li>
+
+ </ul>
+
+ <p> The byte order of a view buffer is fixed to be that of its byte buffer
+ at the time that the view is created.  </p>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4> Invocation chaining </h4>
+
+
+ <p> Methods in this class that do not otherwise have a value to return are
+ specified to return the buffer upon which they are invoked.  This allows
+ method invocations to be chained.
+
+
+
+ The sequence of statements
+
+ <blockquote><pre>
+ bb.putInt(0xCAFEBABE);
+ bb.putShort(3);
+ bb.putShort(45);</pre></blockquote>
+
+ can, for example, be replaced by the single statement
+
+ <blockquote><pre>
+ bb.putInt(0xCAFEBABE).putShort(3).putShort(45);</pre></blockquote>
+<P>
+
+<P>
+<DL>
+<DT><B>Since:</B></DT>
+  <DD>1.4</DD>
+</DL>
+<HR>
+
+<P>
+
+<!-- ========== 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>static&nbsp;<A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A></CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#allocate(int)">allocate</A></B>(int&nbsp;capacity)</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Allocates a new byte buffer.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>static&nbsp;<A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A></CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#allocateDirect(int)">allocateDirect</A></B>(int&nbsp;capacity)</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Allocates a new direct byte buffer.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>&nbsp;byte[]</CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#array()">array</A></B>()</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the byte array that backs this
+ buffer&nbsp;&nbsp;<i>(optional operation)</i>.</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/nio/ByteBuffer.html#arrayOffset()">arrayOffset</A></B>()</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the offset within this buffer's backing array of the first
+ element of the buffer&nbsp;&nbsp;<i>(optional operation)</i>.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;<A HREF="../../java/nio/CharBuffer.html" title="class in java.nio">CharBuffer</A></CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#asCharBuffer()">asCharBuffer</A></B>()</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a view of this byte buffer as a char buffer.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;<A HREF="../../java/nio/DoubleBuffer.html" title="class in java.nio">DoubleBuffer</A></CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#asDoubleBuffer()">asDoubleBuffer</A></B>()</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a view of this byte buffer as a double buffer.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;<A HREF="../../java/nio/FloatBuffer.html" title="class in java.nio">FloatBuffer</A></CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#asFloatBuffer()">asFloatBuffer</A></B>()</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a view of this byte buffer as a float buffer.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;<A HREF="../../java/nio/IntBuffer.html" title="class in java.nio">IntBuffer</A></CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#asIntBuffer()">asIntBuffer</A></B>()</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a view of this byte buffer as an int buffer.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;<A HREF="../../java/nio/LongBuffer.html" title="class in java.nio">LongBuffer</A></CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#asLongBuffer()">asLongBuffer</A></B>()</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a view of this byte buffer as a long buffer.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;<A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A></CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#asReadOnlyBuffer()">asReadOnlyBuffer</A></B>()</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a new, read-only byte buffer that shares this buffer's
+ content.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;<A HREF="../../java/nio/ShortBuffer.html" title="class in java.nio">ShortBuffer</A></CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#asShortBuffer()">asShortBuffer</A></B>()</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a view of this byte buffer as a short buffer.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;<A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A></CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#compact()">compact</A></B>()</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Compacts this buffer&nbsp;&nbsp;<i>(optional operation)</i>.</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/nio/ByteBuffer.html#compareTo(java.nio.ByteBuffer)">compareTo</A></B>(<A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A>&nbsp;that)</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Compares this buffer to another.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;<A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A></CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#duplicate()">duplicate</A></B>()</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a new byte buffer that shares this buffer's content.</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/nio/ByteBuffer.html#equals(java.lang.Object)">equals</A></B>(<A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A>&nbsp;ob)</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tells whether or not this buffer is equal to another object.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;byte</CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#get()">get</A></B>()</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Relative <i>get</i> method.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>&nbsp;<A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A></CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#get(byte[])">get</A></B>(byte[]&nbsp;dst)</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Relative bulk <i>get</i> method.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>&nbsp;<A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A></CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#get(byte[], int, int)">get</A></B>(byte[]&nbsp;dst,
+    int&nbsp;offset,
+    int&nbsp;length)</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Relative bulk <i>get</i> method.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;byte</CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#get(int)">get</A></B>(int&nbsp;index)</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Absolute <i>get</i> method.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;char</CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#getChar()">getChar</A></B>()</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Relative <i>get</i> method for reading a char value.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;char</CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#getChar(int)">getChar</A></B>(int&nbsp;index)</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Absolute <i>get</i> method for reading a char value.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;double</CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#getDouble()">getDouble</A></B>()</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Relative <i>get</i> method for reading a double value.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;double</CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#getDouble(int)">getDouble</A></B>(int&nbsp;index)</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Absolute <i>get</i> method for reading a double value.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;float</CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#getFloat()">getFloat</A></B>()</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Relative <i>get</i> method for reading a float value.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;float</CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#getFloat(int)">getFloat</A></B>(int&nbsp;index)</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Absolute <i>get</i> method for reading a float value.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;int</CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#getInt()">getInt</A></B>()</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Relative <i>get</i> method for reading an int value.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;int</CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#getInt(int)">getInt</A></B>(int&nbsp;index)</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Absolute <i>get</i> method for reading an int value.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;long</CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#getLong()">getLong</A></B>()</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Relative <i>get</i> method for reading a long value.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;long</CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#getLong(int)">getLong</A></B>(int&nbsp;index)</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Absolute <i>get</i> method for reading a long value.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;short</CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#getShort()">getShort</A></B>()</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Relative <i>get</i> method for reading a short value.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;short</CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#getShort(int)">getShort</A></B>(int&nbsp;index)</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Absolute <i>get</i> method for reading a short value.</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/nio/ByteBuffer.html#hasArray()">hasArray</A></B>()</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tells whether or not this buffer is backed by an accessible byte
+ array.</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/nio/ByteBuffer.html#hashCode()">hashCode</A></B>()</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the current hash code of this buffer.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;boolean</CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#isDirect()">isDirect</A></B>()</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tells whether or not this byte buffer is direct.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>&nbsp;<A HREF="../../java/nio/ByteOrder.html" title="class in java.nio">ByteOrder</A></CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#order()">order</A></B>()</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieves this buffer's byte order.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>&nbsp;<A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A></CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#order(java.nio.ByteOrder)">order</A></B>(<A HREF="../../java/nio/ByteOrder.html" title="class in java.nio">ByteOrder</A>&nbsp;bo)</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Modifies this buffer's byte order.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;<A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A></CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#put(byte)">put</A></B>(byte&nbsp;b)</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Relative <i>put</i> method&nbsp;&nbsp;<i>(optional operation)</i>.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>&nbsp;<A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A></CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#put(byte[])">put</A></B>(byte[]&nbsp;src)</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Relative bulk <i>put</i> method&nbsp;&nbsp;<i>(optional operation)</i>.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>&nbsp;<A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A></CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#put(byte[], int, int)">put</A></B>(byte[]&nbsp;src,
+    int&nbsp;offset,
+    int&nbsp;length)</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Relative bulk <i>put</i> method&nbsp;&nbsp;<i>(optional operation)</i>.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>&nbsp;<A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A></CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#put(java.nio.ByteBuffer)">put</A></B>(<A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A>&nbsp;src)</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Relative bulk <i>put</i> method&nbsp;&nbsp;<i>(optional operation)</i>.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;<A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A></CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#put(int, byte)">put</A></B>(int&nbsp;index,
+    byte&nbsp;b)</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Absolute <i>put</i> method&nbsp;&nbsp;<i>(optional operation)</i>.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;<A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A></CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#putChar(char)">putChar</A></B>(char&nbsp;value)</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Relative <i>put</i> method for writing a char
+ value&nbsp;&nbsp;<i>(optional operation)</i>.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;<A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A></CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#putChar(int, char)">putChar</A></B>(int&nbsp;index,
+        char&nbsp;value)</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Absolute <i>put</i> method for writing a char
+ value&nbsp;&nbsp;<i>(optional operation)</i>.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;<A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A></CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#putDouble(double)">putDouble</A></B>(double&nbsp;value)</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Relative <i>put</i> method for writing a double
+ value&nbsp;&nbsp;<i>(optional operation)</i>.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;<A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A></CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#putDouble(int, double)">putDouble</A></B>(int&nbsp;index,
+          double&nbsp;value)</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Absolute <i>put</i> method for writing a double
+ value&nbsp;&nbsp;<i>(optional operation)</i>.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;<A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A></CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#putFloat(float)">putFloat</A></B>(float&nbsp;value)</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Relative <i>put</i> method for writing a float
+ value&nbsp;&nbsp;<i>(optional operation)</i>.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;<A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A></CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#putFloat(int, float)">putFloat</A></B>(int&nbsp;index,
+         float&nbsp;value)</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Absolute <i>put</i> method for writing a float
+ value&nbsp;&nbsp;<i>(optional operation)</i>.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;<A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A></CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#putInt(int)">putInt</A></B>(int&nbsp;value)</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Relative <i>put</i> method for writing an int
+ value&nbsp;&nbsp;<i>(optional operation)</i>.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;<A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A></CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#putInt(int, int)">putInt</A></B>(int&nbsp;index,
+       int&nbsp;value)</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Absolute <i>put</i> method for writing an int
+ value&nbsp;&nbsp;<i>(optional operation)</i>.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;<A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A></CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#putLong(int, long)">putLong</A></B>(int&nbsp;index,
+        long&nbsp;value)</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Absolute <i>put</i> method for writing a long
+ value&nbsp;&nbsp;<i>(optional operation)</i>.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;<A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A></CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#putLong(long)">putLong</A></B>(long&nbsp;value)</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Relative <i>put</i> method for writing a long
+ value&nbsp;&nbsp;<i>(optional operation)</i>.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;<A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A></CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#putShort(int, short)">putShort</A></B>(int&nbsp;index,
+         short&nbsp;value)</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Absolute <i>put</i> method for writing a short
+ value&nbsp;&nbsp;<i>(optional operation)</i>.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;<A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A></CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#putShort(short)">putShort</A></B>(short&nbsp;value)</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Relative <i>put</i> method for writing a short
+ value&nbsp;&nbsp;<i>(optional operation)</i>.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>abstract &nbsp;<A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A></CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#slice()">slice</A></B>()</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a new byte buffer whose content is a shared subsequence of
+ this buffer's content.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>&nbsp;<A HREF="../../java/lang/String.html" title="class in java.lang">String</A></CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#toString()">toString</A></B>()</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a string summarizing the state of this buffer.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>static&nbsp;<A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A></CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#wrap(byte[])">wrap</A></B>(byte[]&nbsp;array)</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Wraps a byte array into a buffer.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>static&nbsp;<A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A></CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../java/nio/ByteBuffer.html#wrap(byte[], int, int)">wrap</A></B>(byte[]&nbsp;array,
+     int&nbsp;offset,
+     int&nbsp;length)</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Wraps a byte array into a buffer.</TD>
+</TR>
+</TABLE>
+&nbsp;<A NAME="methods_inherited_from_class_java.nio.Buffer"><!-- --></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.nio.<A HREF="../../java/nio/Buffer.html" title="class in java.nio">Buffer</A></B></TH>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD><CODE><A HREF="../../java/nio/Buffer.html#capacity()">capacity</A>, <A HREF="../../java/nio/Buffer.html#clear()">clear</A>, <A HREF="../../java/nio/Buffer.html#flip()">flip</A>, <A HREF="../../java/nio/Buffer.html#hasRemaining()">hasRemaining</A>, <A HREF="../../java/nio/Buffer.html#isReadOnly()">isReadOnly</A>, <A HREF="../../java/nio/Buffer.html#limit()">limit</A>, <A HREF="../../java/nio/Buffer.html#limit(int)">limit</A>, <A HREF="../../java/nio/Buffer.html#mark()">mark</A>, <A HREF="../../java/nio/Buffer.html#position()">position</A>, <A HREF="../../java/nio/Buffer.html#position(int)">position</A>, <A HREF="../../java/nio/Buffer.html#remaining()">remaining</A>, <A HREF="../../java/nio/Buffer.html#reset()">reset</A>, <A HREF="../../java/nio/Buffer.html#rewind()">rewind</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">
+<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A></B></TH>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD><CODE><A HREF="../../java/lang/Object.html#clone()">clone</A>, <A HREF="../../java/lang/Object.html#finalize()">finalize</A>, <A HREF="../../java/lang/Object.html#getClass()">getClass</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>
+&nbsp;
+<P>
+
+<!-- ============ 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="allocateDirect(int)"><!-- --></A><H3>
+allocateDirect</H3>
+<PRE>
+public static <A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A> <B>allocateDirect</B>(int&nbsp;capacity)</PRE>
+<DL>
+<DD>Allocates a new direct byte buffer.
+
+ <p> The new buffer's position will be zero, its limit will be its
+ capacity, and its mark will be undefined.  Whether or not it has a
+ <A HREF="../../java/nio/ByteBuffer.html#hasArray()"><CODE></code>backing array<code></CODE></A> is unspecified.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>capacity</CODE> - The new buffer's capacity, in bytes
+<DT><B>Returns:</B><DD>The new byte buffer
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</A></CODE> - If the <tt>capacity</tt> is a negative integer</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="allocate(int)"><!-- --></A><H3>
+allocate</H3>
+<PRE>
+public static <A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A> <B>allocate</B>(int&nbsp;capacity)</PRE>
+<DL>
+<DD>Allocates a new byte buffer.
+
+ <p> The new buffer's position will be zero, its limit will be its
+ capacity, and its mark will be undefined.  It will have a <A HREF="../../java/nio/ByteBuffer.html#array()"><CODE></code>backing array<code></CODE></A>, and its <A HREF="../../java/nio/ByteBuffer.html#arrayOffset()"><CODE></code>array
+ offset<code></CODE></A> will be zero.
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>capacity</CODE> - The new buffer's capacity, in bytes
+<DT><B>Returns:</B><DD>The new byte buffer
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</A></CODE> - If the <tt>capacity</tt> is a negative integer</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="wrap(byte[], int, int)"><!-- --></A><H3>
+wrap</H3>
+<PRE>
+public static <A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A> <B>wrap</B>(byte[]&nbsp;array,
+                              int&nbsp;offset,
+                              int&nbsp;length)</PRE>
+<DL>
+<DD>Wraps a byte array into a buffer.
+
+ <p> The new buffer will be backed by the given byte array;
+ that is, modifications to the buffer will cause the array to be modified
+ and vice versa.  The new buffer's capacity will be
+ <tt>array.length</tt>, its position will be <tt>offset</tt>, its limit
+ will be <tt>offset + length</tt>, and its mark will be undefined.  Its
+ <A HREF="../../java/nio/ByteBuffer.html#array()"><CODE></code>backing array<code></CODE></A> will be the given array, and
+ its <A HREF="../../java/nio/ByteBuffer.html#arrayOffset()"><CODE></code>array offset<code></CODE></A> will be zero.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>array</CODE> - The array that will back the new buffer<DD><CODE>offset</CODE> - The offset of the subarray to be used; must be non-negative and
+         no larger than <tt>array.length</tt>.  The new buffer's position
+         will be set to this value.<DD><CODE>length</CODE> - The length of the subarray to be used;
+         must be non-negative and no larger than
+         <tt>array.length - offset</tt>.
+         The new buffer's limit will be set to <tt>offset + length</tt>.
+<DT><B>Returns:</B><DD>The new byte buffer
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/lang/IndexOutOfBoundsException.html" title="class in java.lang">IndexOutOfBoundsException</A></CODE> - If the preconditions on the <tt>offset</tt> and <tt>length</tt>
+          parameters do not hold</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="wrap(byte[])"><!-- --></A><H3>
+wrap</H3>
+<PRE>
+public static <A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A> <B>wrap</B>(byte[]&nbsp;array)</PRE>
+<DL>
+<DD>Wraps a byte array into a buffer.
+
+ <p> The new buffer will be backed by the given byte array;
+ that is, modifications to the buffer will cause the array to be modified
+ and vice versa.  The new buffer's capacity and limit will be
+ <tt>array.length</tt>, its position will be zero, and its mark will be
+ undefined.  Its <A HREF="../../java/nio/ByteBuffer.html#array()"><CODE></code>backing array<code></CODE></A> will be the
+ given array, and its <A HREF="../../java/nio/ByteBuffer.html#arrayOffset()"><CODE></code>array offset<code></CODE></A> will
+ be zero.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>array</CODE> - The array that will back this buffer
+<DT><B>Returns:</B><DD>The new byte buffer</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="slice()"><!-- --></A><H3>
+slice</H3>
+<PRE>
+public abstract <A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A> <B>slice</B>()</PRE>
+<DL>
+<DD>Creates a new byte buffer whose content is a shared subsequence of
+ this buffer's content.
+
+ <p> The content of the new buffer will start at this buffer's current
+ position.  Changes to this buffer's content will be visible in the new
+ buffer, and vice versa; the two buffers' position, limit, and mark
+ values will be independent.
+
+ <p> The new buffer's position will be zero, its capacity and its limit
+ will be the number of bytes remaining in this buffer, and its mark
+ will be undefined.  The new buffer will be direct if, and only if, this
+ buffer is direct, and it will be read-only if, and only if, this buffer
+ is read-only.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+
+<DT><B>Returns:</B><DD>The new byte buffer</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="duplicate()"><!-- --></A><H3>
+duplicate</H3>
+<PRE>
+public abstract <A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A> <B>duplicate</B>()</PRE>
+<DL>
+<DD>Creates a new byte buffer that shares this buffer's content.
+
+ <p> The content of the new buffer will be that of this buffer.  Changes
+ to this buffer's content will be visible in the new buffer, and vice
+ versa; the two buffers' position, limit, and mark values will be
+ independent.
+
+ <p> The new buffer's capacity, limit, position, and mark values will be
+ identical to those of this buffer.  The new buffer will be direct if,
+ and only if, this buffer is direct, and it will be read-only if, and
+ only if, this buffer is read-only.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+
+<DT><B>Returns:</B><DD>The new byte buffer</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="asReadOnlyBuffer()"><!-- --></A><H3>
+asReadOnlyBuffer</H3>
+<PRE>
+public abstract <A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A> <B>asReadOnlyBuffer</B>()</PRE>
+<DL>
+<DD>Creates a new, read-only byte buffer that shares this buffer's
+ content.
+
+ <p> The content of the new buffer will be that of this buffer.  Changes
+ to this buffer's content will be visible in the new buffer; the new
+ buffer itself, however, will be read-only and will not allow the shared
+ content to be modified.  The two buffers' position, limit, and mark
+ values will be independent.
+
+ <p> The new buffer's capacity, limit, position, and mark values will be
+ identical to those of this buffer.
+
+ <p> If this buffer is itself read-only then this method behaves in
+ exactly the same way as the <A HREF="../../java/nio/ByteBuffer.html#duplicate()"><CODE>duplicate</CODE></A> method.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+
+<DT><B>Returns:</B><DD>The new, read-only byte buffer</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="get()"><!-- --></A><H3>
+get</H3>
+<PRE>
+public abstract byte <B>get</B>()</PRE>
+<DL>
+<DD>Relative <i>get</i> method.  Reads the byte at this buffer's
+ current position, and then increments the position. </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+
+<DT><B>Returns:</B><DD>The byte at the buffer's current position
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/nio/BufferUnderflowException.html" title="class in java.nio">BufferUnderflowException</A></CODE> - If the buffer's current position is not smaller than its limit</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="put(byte)"><!-- --></A><H3>
+put</H3>
+<PRE>
+public abstract <A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A> <B>put</B>(byte&nbsp;b)</PRE>
+<DL>
+<DD>Relative <i>put</i> method&nbsp;&nbsp;<i>(optional operation)</i>.
+ 
+ <p> Writes the given byte into this buffer at the current
+ position, and then increments the position. </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>b</CODE> - The byte to be written
+<DT><B>Returns:</B><DD>This buffer
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/nio/BufferOverflowException.html" title="class in java.nio">BufferOverflowException</A></CODE> - If this buffer's current position is not smaller than its limit
+<DD><CODE><A HREF="../../java/nio/ReadOnlyBufferException.html" title="class in java.nio">ReadOnlyBufferException</A></CODE> - If this buffer is read-only</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="get(int)"><!-- --></A><H3>
+get</H3>
+<PRE>
+public abstract byte <B>get</B>(int&nbsp;index)</PRE>
+<DL>
+<DD>Absolute <i>get</i> method.  Reads the byte at the given
+ index. </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>index</CODE> - The index from which the byte will be read
+<DT><B>Returns:</B><DD>The byte at the given index
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/lang/IndexOutOfBoundsException.html" title="class in java.lang">IndexOutOfBoundsException</A></CODE> - If <tt>index</tt> is negative
+          or not smaller than the buffer's limit</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="put(int, byte)"><!-- --></A><H3>
+put</H3>
+<PRE>
+public abstract <A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A> <B>put</B>(int&nbsp;index,
+                               byte&nbsp;b)</PRE>
+<DL>
+<DD>Absolute <i>put</i> method&nbsp;&nbsp;<i>(optional operation)</i>.
+ 
+ <p> Writes the given byte into this buffer at the given
+ index. </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>index</CODE> - The index at which the byte will be written<DD><CODE>b</CODE> - The byte value to be written
+<DT><B>Returns:</B><DD>This buffer
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/lang/IndexOutOfBoundsException.html" title="class in java.lang">IndexOutOfBoundsException</A></CODE> - If <tt>index</tt> is negative
+          or not smaller than the buffer's limit
+<DD><CODE><A HREF="../../java/nio/ReadOnlyBufferException.html" title="class in java.nio">ReadOnlyBufferException</A></CODE> - If this buffer is read-only</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="get(byte[], int, int)"><!-- --></A><H3>
+get</H3>
+<PRE>
+public <A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A> <B>get</B>(byte[]&nbsp;dst,
+                      int&nbsp;offset,
+                      int&nbsp;length)</PRE>
+<DL>
+<DD>Relative bulk <i>get</i> method.
+
+ <p> This method transfers bytes from this buffer into the given
+ destination array.  If there are fewer bytes remaining in the
+ buffer than are required to satisfy the request, that is, if
+ <tt>length</tt>&nbsp;<tt>&gt;</tt>&nbsp;<tt>remaining()</tt>, then no
+ bytes are transferred and a <A HREF="../../java/nio/BufferUnderflowException.html" title="class in java.nio"><CODE>BufferUnderflowException</CODE></A> is
+ thrown.
+
+ <p> Otherwise, this method copies <tt>length</tt> bytes from this
+ buffer into the given array, starting at the current position of this
+ buffer and at the given offset in the array.  The position of this
+ buffer is then incremented by <tt>length</tt>.
+
+ <p> In other words, an invocation of this method of the form
+ <tt>src.get(dst,&nbsp;off,&nbsp;len)</tt> has exactly the same effect as
+ the loop
+
+ <pre>
+     for (int i = off; i < off + len; i++)
+         dst[i] = src.get(); </pre>
+
+ except that it first checks that there are sufficient bytes in
+ this buffer and it is potentially much more efficient. </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>dst</CODE> - The array into which bytes are to be written<DD><CODE>offset</CODE> - The offset within the array of the first byte to be
+         written; must be non-negative and no larger than
+         <tt>dst.length</tt><DD><CODE>length</CODE> - The maximum number of bytes to be written to the given
+         array; must be non-negative and no larger than
+         <tt>dst.length - offset</tt>
+<DT><B>Returns:</B><DD>This buffer
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/nio/BufferUnderflowException.html" title="class in java.nio">BufferUnderflowException</A></CODE> - If there are fewer than <tt>length</tt> bytes
+          remaining in this buffer
+<DD><CODE><A HREF="../../java/lang/IndexOutOfBoundsException.html" title="class in java.lang">IndexOutOfBoundsException</A></CODE> - If the preconditions on the <tt>offset</tt> and <tt>length</tt>
+          parameters do not hold</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="get(byte[])"><!-- --></A><H3>
+get</H3>
+<PRE>
+public <A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A> <B>get</B>(byte[]&nbsp;dst)</PRE>
+<DL>
+<DD>Relative bulk <i>get</i> method.
+
+ <p> This method transfers bytes from this buffer into the given
+ destination array.  An invocation of this method of the form
+ <tt>src.get(a)</tt> behaves in exactly the same way as the invocation
+
+ <pre>
+     src.get(a, 0, a.length) </pre>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+
+<DT><B>Returns:</B><DD>This buffer
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/nio/BufferUnderflowException.html" title="class in java.nio">BufferUnderflowException</A></CODE> - If there are fewer than <tt>length</tt> bytes
+          remaining in this buffer</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="put(java.nio.ByteBuffer)"><!-- --></A><H3>
+put</H3>
+<PRE>
+public <A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A> <B>put</B>(<A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A>&nbsp;src)</PRE>
+<DL>
+<DD>Relative bulk <i>put</i> method&nbsp;&nbsp;<i>(optional operation)</i>.
+
+ <p> This method transfers the bytes remaining in the given source
+ buffer into this buffer.  If there are more bytes remaining in the
+ source buffer than in this buffer, that is, if
+ <tt>src.remaining()</tt>&nbsp;<tt>&gt;</tt>&nbsp;<tt>remaining()</tt>,
+ then no bytes are transferred and a <A HREF="../../java/nio/BufferOverflowException.html" title="class in java.nio"><CODE>BufferOverflowException</CODE></A> is thrown.
+
+ <p> Otherwise, this method copies
+ <i>n</i>&nbsp;=&nbsp;<tt>src.remaining()</tt> bytes from the given
+ buffer into this buffer, starting at each buffer's current position.
+ The positions of both buffers are then incremented by <i>n</i>.
+
+ <p> In other words, an invocation of this method of the form
+ <tt>dst.put(src)</tt> has exactly the same effect as the loop
+
+ <pre>
+     while (src.hasRemaining())
+         dst.put(src.get()); </pre>
+
+ except that it first checks that there is sufficient space in this
+ buffer and it is potentially much more efficient. </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>src</CODE> - The source buffer from which bytes are to be read;
+         must not be this buffer
+<DT><B>Returns:</B><DD>This buffer
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/nio/BufferOverflowException.html" title="class in java.nio">BufferOverflowException</A></CODE> - If there is insufficient space in this buffer
+          for the remaining bytes in the source buffer
+<DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</A></CODE> - If the source buffer is this buffer
+<DD><CODE><A HREF="../../java/nio/ReadOnlyBufferException.html" title="class in java.nio">ReadOnlyBufferException</A></CODE> - If this buffer is read-only</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="put(byte[], int, int)"><!-- --></A><H3>
+put</H3>
+<PRE>
+public <A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A> <B>put</B>(byte[]&nbsp;src,
+                      int&nbsp;offset,
+                      int&nbsp;length)</PRE>
+<DL>
+<DD>Relative bulk <i>put</i> method&nbsp;&nbsp;<i>(optional operation)</i>.
+
+ <p> This method transfers bytes into this buffer from the given
+ source array.  If there are more bytes to be copied from the array
+ than remain in this buffer, that is, if
+ <tt>length</tt>&nbsp;<tt>&gt;</tt>&nbsp;<tt>remaining()</tt>, then no
+ bytes are transferred and a <A HREF="../../java/nio/BufferOverflowException.html" title="class in java.nio"><CODE>BufferOverflowException</CODE></A> is
+ thrown.
+
+ <p> Otherwise, this method copies <tt>length</tt> bytes from the
+ given array into this buffer, starting at the given offset in the array
+ and at the current position of this buffer.  The position of this buffer
+ is then incremented by <tt>length</tt>.
+
+ <p> In other words, an invocation of this method of the form
+ <tt>dst.put(src,&nbsp;off,&nbsp;len)</tt> has exactly the same effect as
+ the loop
+
+ <pre>
+     for (int i = off; i < off + len; i++)
+         dst.put(a[i]); </pre>
+
+ except that it first checks that there is sufficient space in this
+ buffer and it is potentially much more efficient. </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>src</CODE> - The array from which bytes are to be read<DD><CODE>offset</CODE> - The offset within the array of the first byte to be read;
+         must be non-negative and no larger than <tt>array.length</tt><DD><CODE>length</CODE> - The number of bytes to be read from the given array;
+         must be non-negative and no larger than
+         <tt>array.length - offset</tt>
+<DT><B>Returns:</B><DD>This buffer
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/nio/BufferOverflowException.html" title="class in java.nio">BufferOverflowException</A></CODE> - If there is insufficient space in this buffer
+<DD><CODE><A HREF="../../java/lang/IndexOutOfBoundsException.html" title="class in java.lang">IndexOutOfBoundsException</A></CODE> - If the preconditions on the <tt>offset</tt> and <tt>length</tt>
+          parameters do not hold
+<DD><CODE><A HREF="../../java/nio/ReadOnlyBufferException.html" title="class in java.nio">ReadOnlyBufferException</A></CODE> - If this buffer is read-only</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="put(byte[])"><!-- --></A><H3>
+put</H3>
+<PRE>
+public final <A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A> <B>put</B>(byte[]&nbsp;src)</PRE>
+<DL>
+<DD>Relative bulk <i>put</i> method&nbsp;&nbsp;<i>(optional operation)</i>.
+
+ <p> This method transfers the entire content of the given source
+ byte array into this buffer.  An invocation of this method of the
+ form <tt>dst.put(a)</tt> behaves in exactly the same way as the
+ invocation
+
+ <pre>
+     dst.put(a, 0, a.length) </pre>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+
+<DT><B>Returns:</B><DD>This buffer
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/nio/BufferOverflowException.html" title="class in java.nio">BufferOverflowException</A></CODE> - If there is insufficient space in this buffer
+<DD><CODE><A HREF="../../java/nio/ReadOnlyBufferException.html" title="class in java.nio">ReadOnlyBufferException</A></CODE> - If this buffer is read-only</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="hasArray()"><!-- --></A><H3>
+hasArray</H3>
+<PRE>
+public final boolean <B>hasArray</B>()</PRE>
+<DL>
+<DD>Tells whether or not this buffer is backed by an accessible byte
+ array.
+
+ <p> If this method returns <tt>true</tt> then the <A HREF="../../java/nio/ByteBuffer.html#array()"><CODE>array</CODE></A>
+ and <A HREF="../../java/nio/ByteBuffer.html#arrayOffset()"><CODE>arrayOffset</CODE></A> methods may safely be invoked.
+ </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+
+<DT><B>Returns:</B><DD><tt>true</tt> if, and only if, this buffer
+          is backed by an array and is not read-only</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="array()"><!-- --></A><H3>
+array</H3>
+<PRE>
+public final byte[] <B>array</B>()</PRE>
+<DL>
+<DD>Returns the byte array that backs this
+ buffer&nbsp;&nbsp;<i>(optional operation)</i>.
+
+ <p> Modifications to this buffer's content will cause the returned
+ array's content to be modified, and vice versa.
+
+ <p> Invoke the <A HREF="../../java/nio/ByteBuffer.html#hasArray()"><CODE>hasArray</CODE></A> method before invoking this
+ method in order to ensure that this buffer has an accessible backing
+ array.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+
+<DT><B>Returns:</B><DD>The array that backs this buffer
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/nio/ReadOnlyBufferException.html" title="class in java.nio">ReadOnlyBufferException</A></CODE> - If this buffer is backed by an array but is read-only
+<DD><CODE><A HREF="../../java/lang/UnsupportedOperationException.html" title="class in java.lang">UnsupportedOperationException</A></CODE> - If this buffer is not backed by an accessible array</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="arrayOffset()"><!-- --></A><H3>
+arrayOffset</H3>
+<PRE>
+public final int <B>arrayOffset</B>()</PRE>
+<DL>
+<DD>Returns the offset within this buffer's backing array of the first
+ element of the buffer&nbsp;&nbsp;<i>(optional operation)</i>.
+
+ <p> If this buffer is backed by an array then buffer position <i>p</i>
+ corresponds to array index <i>p</i>&nbsp;+&nbsp;<tt>arrayOffset()</tt>.
+
+ <p> Invoke the <A HREF="../../java/nio/ByteBuffer.html#hasArray()"><CODE>hasArray</CODE></A> method before invoking this
+ method in order to ensure that this buffer has an accessible backing
+ array.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+
+<DT><B>Returns:</B><DD>The offset within this buffer's array
+          of the first element of the buffer
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/nio/ReadOnlyBufferException.html" title="class in java.nio">ReadOnlyBufferException</A></CODE> - If this buffer is backed by an array but is read-only
+<DD><CODE><A HREF="../../java/lang/UnsupportedOperationException.html" title="class in java.lang">UnsupportedOperationException</A></CODE> - If this buffer is not backed by an accessible array</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="compact()"><!-- --></A><H3>
+compact</H3>
+<PRE>
+public abstract <A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A> <B>compact</B>()</PRE>
+<DL>
+<DD>Compacts this buffer&nbsp;&nbsp;<i>(optional operation)</i>.
+
+ <p> The bytes between the buffer's current position and its limit,
+ if any, are copied to the beginning of the buffer.  That is, the
+ byte at index <i>p</i>&nbsp;=&nbsp;<tt>position()</tt> is copied
+ to index zero, the byte at index <i>p</i>&nbsp;+&nbsp;1 is copied
+ to index one, and so forth until the byte at index
+ <tt>limit()</tt>&nbsp;-&nbsp;1 is copied to index
+ <i>n</i>&nbsp;=&nbsp;<tt>limit()</tt>&nbsp;-&nbsp;<tt>1</tt>&nbsp;-&nbsp;<i>p</i>.
+ The buffer's position is then set to <i>n+1</i> and its limit is set to
+ its capacity.  The mark, if defined, is discarded.
+
+ <p> The buffer's position is set to the number of bytes copied,
+ rather than to zero, so that an invocation of this method can be
+ followed immediately by an invocation of another relative <i>put</i>
+ method. </p>
+
+
+
+ <p> Invoke this method after writing data from a buffer in case the
+ write was incomplete.  The following loop, for example, copies bytes
+ from one channel to another via the buffer <tt>buf</tt>:
+
+ <blockquote><pre>
+ buf.clear();          // Prepare buffer for use
+ for (;;) {
+     if (in.read(buf) < 0 && !buf.hasRemaining())
+         break;        // No more bytes to transfer
+     buf.flip();
+     out.write(buf);
+     buf.compact();    // In case of partial write
+ }</pre></blockquote>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+
+<DT><B>Returns:</B><DD>This buffer
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/nio/ReadOnlyBufferException.html" title="class in java.nio">ReadOnlyBufferException</A></CODE> - If this buffer is read-only</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="isDirect()"><!-- --></A><H3>
+isDirect</H3>
+<PRE>
+public abstract boolean <B>isDirect</B>()</PRE>
+<DL>
+<DD>Tells whether or not this byte buffer is direct. </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+
+<DT><B>Returns:</B><DD><tt>true</tt> if, and only if, this buffer is direct</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="toString()"><!-- --></A><H3>
+toString</H3>
+<PRE>
+public <A HREF="../../java/lang/String.html" title="class in java.lang">String</A> <B>toString</B>()</PRE>
+<DL>
+<DD>Returns a string summarizing the state of this buffer.  </p>
+<P>
+<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" title="class in java.lang">Object</A></CODE></DL>
+</DD>
+<DD><DL>
+
+<DT><B>Returns:</B><DD>A summary string</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="hashCode()"><!-- --></A><H3>
+hashCode</H3>
+<PRE>
+public int <B>hashCode</B>()</PRE>
+<DL>
+<DD>Returns the current hash code of this buffer.
+
+ <p> The hash code of a byte buffer depends only upon its remaining
+ elements; that is, upon the elements from <tt>position()</tt> up to, and
+ including, the element at <tt>limit()</tt>&nbsp;-&nbsp;<tt>1</tt>.
+
+ <p> Because buffer hash codes are content-dependent, it is inadvisable
+ to use buffers as keys in hash maps or similar data structures unless it
+ is known that their contents will not change.  </p>
+<P>
+<DD><DL>
+<DT><B>Overrides:</B><DD><CODE><A HREF="../../java/lang/Object.html#hashCode()">hashCode</A></CODE> in class <CODE><A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A></CODE></DL>
+</DD>
+<DD><DL>
+
+<DT><B>Returns:</B><DD>The current hash code of this buffer<DT><B>See Also:</B><DD><A HREF="../../java/lang/Object.html#equals(java.lang.Object)"><CODE>Object.equals(java.lang.Object)</CODE></A>, 
+<A HREF="../../java/util/Hashtable.html" title="class in java.util"><CODE>Hashtable</CODE></A></DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="equals(java.lang.Object)"><!-- --></A><H3>
+equals</H3>
+<PRE>
+public boolean <B>equals</B>(<A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A>&nbsp;ob)</PRE>
+<DL>
+<DD>Tells whether or not this buffer is equal to another object.
+
+ <p> Two byte buffers are equal if, and only if,
+
+ <p><ol>
+
+   <li><p> They have the same element type,  </p></li>
+
+   <li><p> They have the same number of remaining elements, and
+   </p></li>
+
+   <li><p> The two sequences of remaining elements, considered
+   independently of their starting positions, are pointwise equal.
+   </p></li>
+
+ </ol>
+
+ <p> A byte buffer is not equal to any other type of object.  </p>
+<P>
+<DD><DL>
+<DT><B>Overrides:</B><DD><CODE><A HREF="../../java/lang/Object.html#equals(java.lang.Object)">equals</A></CODE> in class <CODE><A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A></CODE></DL>
+</DD>
+<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>ob</CODE> - The object to which this buffer is to be compared
+<DT><B>Returns:</B><DD><tt>true</tt> if, and only if, this buffer is equal to the
+           given object<DT><B>See Also:</B><DD><A HREF="../../java/lang/Object.html#hashCode()"><CODE>Object.hashCode()</CODE></A>, 
+<A HREF="../../java/util/Hashtable.html" title="class in java.util"><CODE>Hashtable</CODE></A></DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="compareTo(java.nio.ByteBuffer)"><!-- --></A><H3>
+compareTo</H3>
+<PRE>
+public int <B>compareTo</B>(<A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A>&nbsp;that)</PRE>
+<DL>
+<DD>Compares this buffer to another.
+
+ <p> Two byte buffers are compared by comparing their sequences of
+ remaining elements lexicographically, without regard to the starting
+ position of each sequence within its corresponding buffer.
+
+ <p> A byte buffer is not comparable to any other type of object.
+<P>
+<DD><DL>
+<DT><B>Specified by:</B><DD><CODE><A HREF="../../java/lang/Comparable.html#compareTo(T)">compareTo</A></CODE> in interface <CODE><A HREF="../../java/lang/Comparable.html" title="interface in java.lang">Comparable</A>&lt;<A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A>&gt;</CODE></DL>
+</DD>
+<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>that</CODE> - the Object to be compared.
+<DT><B>Returns:</B><DD>A negative integer, zero, or a positive integer as this buffer
+                is less than, equal to, or greater than the given buffer</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="order()"><!-- --></A><H3>
+order</H3>
+<PRE>
+public final <A HREF="../../java/nio/ByteOrder.html" title="class in java.nio">ByteOrder</A> <B>order</B>()</PRE>
+<DL>
+<DD>Retrieves this buffer's byte order.
+
+ <p> The byte order is used when reading or writing multibyte values, and
+ when creating buffers that are views of this byte buffer.  The order of
+ a newly-created byte buffer is always <A HREF="../../java/nio/ByteOrder.html#BIG_ENDIAN"><CODE>BIG_ENDIAN</CODE></A>.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+
+<DT><B>Returns:</B><DD>This buffer's byte order</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="order(java.nio.ByteOrder)"><!-- --></A><H3>
+order</H3>
+<PRE>
+public final <A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A> <B>order</B>(<A HREF="../../java/nio/ByteOrder.html" title="class in java.nio">ByteOrder</A>&nbsp;bo)</PRE>
+<DL>
+<DD>Modifies this buffer's byte order.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>bo</CODE> - The new byte order,
+         either <A HREF="../../java/nio/ByteOrder.html#BIG_ENDIAN"><CODE>BIG_ENDIAN</CODE></A>
+         or <A HREF="../../java/nio/ByteOrder.html#LITTLE_ENDIAN"><CODE>LITTLE_ENDIAN</CODE></A>
+<DT><B>Returns:</B><DD>This buffer</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="getChar()"><!-- --></A><H3>
+getChar</H3>
+<PRE>
+public abstract char <B>getChar</B>()</PRE>
+<DL>
+<DD>Relative <i>get</i> method for reading a char value.
+
+ <p> Reads the next two bytes at this buffer's current position,
+ composing them into a char value according to the current byte order,
+ and then increments the position by two.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+
+<DT><B>Returns:</B><DD>The char value at the buffer's current position
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/nio/BufferUnderflowException.html" title="class in java.nio">BufferUnderflowException</A></CODE> - If there are fewer than two bytes
+          remaining in this buffer</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="putChar(char)"><!-- --></A><H3>
+putChar</H3>
+<PRE>
+public abstract <A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A> <B>putChar</B>(char&nbsp;value)</PRE>
+<DL>
+<DD>Relative <i>put</i> method for writing a char
+ value&nbsp;&nbsp;<i>(optional operation)</i>.
+
+ <p> Writes two bytes containing the given char value, in the
+ current byte order, into this buffer at the current position, and then
+ increments the position by two.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>value</CODE> - The char value to be written
+<DT><B>Returns:</B><DD>This buffer
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/nio/BufferOverflowException.html" title="class in java.nio">BufferOverflowException</A></CODE> - If there are fewer than two bytes
+          remaining in this buffer
+<DD><CODE><A HREF="../../java/nio/ReadOnlyBufferException.html" title="class in java.nio">ReadOnlyBufferException</A></CODE> - If this buffer is read-only</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="getChar(int)"><!-- --></A><H3>
+getChar</H3>
+<PRE>
+public abstract char <B>getChar</B>(int&nbsp;index)</PRE>
+<DL>
+<DD>Absolute <i>get</i> method for reading a char value.
+
+ <p> Reads two bytes at the given index, composing them into a
+ char value according to the current byte order.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>index</CODE> - The index from which the bytes will be read
+<DT><B>Returns:</B><DD>The char value at the given index
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/lang/IndexOutOfBoundsException.html" title="class in java.lang">IndexOutOfBoundsException</A></CODE> - If <tt>index</tt> is negative
+          or not smaller than the buffer's limit,
+          minus one</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="putChar(int, char)"><!-- --></A><H3>
+putChar</H3>
+<PRE>
+public abstract <A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A> <B>putChar</B>(int&nbsp;index,
+                                   char&nbsp;value)</PRE>
+<DL>
+<DD>Absolute <i>put</i> method for writing a char
+ value&nbsp;&nbsp;<i>(optional operation)</i>.
+
+ <p> Writes two bytes containing the given char value, in the
+ current byte order, into this buffer at the given index.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>index</CODE> - The index at which the bytes will be written<DD><CODE>value</CODE> - The char value to be written
+<DT><B>Returns:</B><DD>This buffer
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/lang/IndexOutOfBoundsException.html" title="class in java.lang">IndexOutOfBoundsException</A></CODE> - If <tt>index</tt> is negative
+          or not smaller than the buffer's limit,
+          minus one
+<DD><CODE><A HREF="../../java/nio/ReadOnlyBufferException.html" title="class in java.nio">ReadOnlyBufferException</A></CODE> - If this buffer is read-only</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="asCharBuffer()"><!-- --></A><H3>
+asCharBuffer</H3>
+<PRE>
+public abstract <A HREF="../../java/nio/CharBuffer.html" title="class in java.nio">CharBuffer</A> <B>asCharBuffer</B>()</PRE>
+<DL>
+<DD>Creates a view of this byte buffer as a char buffer.
+
+ <p> The content of the new buffer will start at this buffer's current
+ position.  Changes to this buffer's content will be visible in the new
+ buffer, and vice versa; the two buffers' position, limit, and mark
+ values will be independent.
+
+ <p> The new buffer's position will be zero, its capacity and its limit
+ will be the number of bytes remaining in this buffer divided by
+ two, and its mark will be undefined.  The new buffer will be direct
+ if, and only if, this buffer is direct, and it will be read-only if, and
+ only if, this buffer is read-only.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+
+<DT><B>Returns:</B><DD>A new char buffer</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="getShort()"><!-- --></A><H3>
+getShort</H3>
+<PRE>
+public abstract short <B>getShort</B>()</PRE>
+<DL>
+<DD>Relative <i>get</i> method for reading a short value.
+
+ <p> Reads the next two bytes at this buffer's current position,
+ composing them into a short value according to the current byte order,
+ and then increments the position by two.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+
+<DT><B>Returns:</B><DD>The short value at the buffer's current position
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/nio/BufferUnderflowException.html" title="class in java.nio">BufferUnderflowException</A></CODE> - If there are fewer than two bytes
+          remaining in this buffer</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="putShort(short)"><!-- --></A><H3>
+putShort</H3>
+<PRE>
+public abstract <A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A> <B>putShort</B>(short&nbsp;value)</PRE>
+<DL>
+<DD>Relative <i>put</i> method for writing a short
+ value&nbsp;&nbsp;<i>(optional operation)</i>.
+
+ <p> Writes two bytes containing the given short value, in the
+ current byte order, into this buffer at the current position, and then
+ increments the position by two.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>value</CODE> - The short value to be written
+<DT><B>Returns:</B><DD>This buffer
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/nio/BufferOverflowException.html" title="class in java.nio">BufferOverflowException</A></CODE> - If there are fewer than two bytes
+          remaining in this buffer
+<DD><CODE><A HREF="../../java/nio/ReadOnlyBufferException.html" title="class in java.nio">ReadOnlyBufferException</A></CODE> - If this buffer is read-only</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="getShort(int)"><!-- --></A><H3>
+getShort</H3>
+<PRE>
+public abstract short <B>getShort</B>(int&nbsp;index)</PRE>
+<DL>
+<DD>Absolute <i>get</i> method for reading a short value.
+
+ <p> Reads two bytes at the given index, composing them into a
+ short value according to the current byte order.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>index</CODE> - The index from which the bytes will be read
+<DT><B>Returns:</B><DD>The short value at the given index
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/lang/IndexOutOfBoundsException.html" title="class in java.lang">IndexOutOfBoundsException</A></CODE> - If <tt>index</tt> is negative
+          or not smaller than the buffer's limit,
+          minus one</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="putShort(int, short)"><!-- --></A><H3>
+putShort</H3>
+<PRE>
+public abstract <A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A> <B>putShort</B>(int&nbsp;index,
+                                    short&nbsp;value)</PRE>
+<DL>
+<DD>Absolute <i>put</i> method for writing a short
+ value&nbsp;&nbsp;<i>(optional operation)</i>.
+
+ <p> Writes two bytes containing the given short value, in the
+ current byte order, into this buffer at the given index.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>index</CODE> - The index at which the bytes will be written<DD><CODE>value</CODE> - The short value to be written
+<DT><B>Returns:</B><DD>This buffer
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/lang/IndexOutOfBoundsException.html" title="class in java.lang">IndexOutOfBoundsException</A></CODE> - If <tt>index</tt> is negative
+          or not smaller than the buffer's limit,
+          minus one
+<DD><CODE><A HREF="../../java/nio/ReadOnlyBufferException.html" title="class in java.nio">ReadOnlyBufferException</A></CODE> - If this buffer is read-only</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="asShortBuffer()"><!-- --></A><H3>
+asShortBuffer</H3>
+<PRE>
+public abstract <A HREF="../../java/nio/ShortBuffer.html" title="class in java.nio">ShortBuffer</A> <B>asShortBuffer</B>()</PRE>
+<DL>
+<DD>Creates a view of this byte buffer as a short buffer.
+
+ <p> The content of the new buffer will start at this buffer's current
+ position.  Changes to this buffer's content will be visible in the new
+ buffer, and vice versa; the two buffers' position, limit, and mark
+ values will be independent.
+
+ <p> The new buffer's position will be zero, its capacity and its limit
+ will be the number of bytes remaining in this buffer divided by
+ two, and its mark will be undefined.  The new buffer will be direct
+ if, and only if, this buffer is direct, and it will be read-only if, and
+ only if, this buffer is read-only.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+
+<DT><B>Returns:</B><DD>A new short buffer</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="getInt()"><!-- --></A><H3>
+getInt</H3>
+<PRE>
+public abstract int <B>getInt</B>()</PRE>
+<DL>
+<DD>Relative <i>get</i> method for reading an int value.
+
+ <p> Reads the next four bytes at this buffer's current position,
+ composing them into an int value according to the current byte order,
+ and then increments the position by four.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+
+<DT><B>Returns:</B><DD>The int value at the buffer's current position
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/nio/BufferUnderflowException.html" title="class in java.nio">BufferUnderflowException</A></CODE> - If there are fewer than four bytes
+          remaining in this buffer</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="putInt(int)"><!-- --></A><H3>
+putInt</H3>
+<PRE>
+public abstract <A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A> <B>putInt</B>(int&nbsp;value)</PRE>
+<DL>
+<DD>Relative <i>put</i> method for writing an int
+ value&nbsp;&nbsp;<i>(optional operation)</i>.
+
+ <p> Writes four bytes containing the given int value, in the
+ current byte order, into this buffer at the current position, and then
+ increments the position by four.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>value</CODE> - The int value to be written
+<DT><B>Returns:</B><DD>This buffer
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/nio/BufferOverflowException.html" title="class in java.nio">BufferOverflowException</A></CODE> - If there are fewer than four bytes
+          remaining in this buffer
+<DD><CODE><A HREF="../../java/nio/ReadOnlyBufferException.html" title="class in java.nio">ReadOnlyBufferException</A></CODE> - If this buffer is read-only</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="getInt(int)"><!-- --></A><H3>
+getInt</H3>
+<PRE>
+public abstract int <B>getInt</B>(int&nbsp;index)</PRE>
+<DL>
+<DD>Absolute <i>get</i> method for reading an int value.
+
+ <p> Reads four bytes at the given index, composing them into a
+ int value according to the current byte order.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>index</CODE> - The index from which the bytes will be read
+<DT><B>Returns:</B><DD>The int value at the given index
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/lang/IndexOutOfBoundsException.html" title="class in java.lang">IndexOutOfBoundsException</A></CODE> - If <tt>index</tt> is negative
+          or not smaller than the buffer's limit,
+          minus three</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="putInt(int, int)"><!-- --></A><H3>
+putInt</H3>
+<PRE>
+public abstract <A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A> <B>putInt</B>(int&nbsp;index,
+                                  int&nbsp;value)</PRE>
+<DL>
+<DD>Absolute <i>put</i> method for writing an int
+ value&nbsp;&nbsp;<i>(optional operation)</i>.
+
+ <p> Writes four bytes containing the given int value, in the
+ current byte order, into this buffer at the given index.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>index</CODE> - The index at which the bytes will be written<DD><CODE>value</CODE> - The int value to be written
+<DT><B>Returns:</B><DD>This buffer
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/lang/IndexOutOfBoundsException.html" title="class in java.lang">IndexOutOfBoundsException</A></CODE> - If <tt>index</tt> is negative
+          or not smaller than the buffer's limit,
+          minus three
+<DD><CODE><A HREF="../../java/nio/ReadOnlyBufferException.html" title="class in java.nio">ReadOnlyBufferException</A></CODE> - If this buffer is read-only</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="asIntBuffer()"><!-- --></A><H3>
+asIntBuffer</H3>
+<PRE>
+public abstract <A HREF="../../java/nio/IntBuffer.html" title="class in java.nio">IntBuffer</A> <B>asIntBuffer</B>()</PRE>
+<DL>
+<DD>Creates a view of this byte buffer as an int buffer.
+
+ <p> The content of the new buffer will start at this buffer's current
+ position.  Changes to this buffer's content will be visible in the new
+ buffer, and vice versa; the two buffers' position, limit, and mark
+ values will be independent.
+
+ <p> The new buffer's position will be zero, its capacity and its limit
+ will be the number of bytes remaining in this buffer divided by
+ four, and its mark will be undefined.  The new buffer will be direct
+ if, and only if, this buffer is direct, and it will be read-only if, and
+ only if, this buffer is read-only.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+
+<DT><B>Returns:</B><DD>A new int buffer</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="getLong()"><!-- --></A><H3>
+getLong</H3>
+<PRE>
+public abstract long <B>getLong</B>()</PRE>
+<DL>
+<DD>Relative <i>get</i> method for reading a long value.
+
+ <p> Reads the next eight bytes at this buffer's current position,
+ composing them into a long value according to the current byte order,
+ and then increments the position by eight.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+
+<DT><B>Returns:</B><DD>The long value at the buffer's current position
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/nio/BufferUnderflowException.html" title="class in java.nio">BufferUnderflowException</A></CODE> - If there are fewer than eight bytes
+          remaining in this buffer</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="putLong(long)"><!-- --></A><H3>
+putLong</H3>
+<PRE>
+public abstract <A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A> <B>putLong</B>(long&nbsp;value)</PRE>
+<DL>
+<DD>Relative <i>put</i> method for writing a long
+ value&nbsp;&nbsp;<i>(optional operation)</i>.
+
+ <p> Writes eight bytes containing the given long value, in the
+ current byte order, into this buffer at the current position, and then
+ increments the position by eight.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>value</CODE> - The long value to be written
+<DT><B>Returns:</B><DD>This buffer
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/nio/BufferOverflowException.html" title="class in java.nio">BufferOverflowException</A></CODE> - If there are fewer than eight bytes
+          remaining in this buffer
+<DD><CODE><A HREF="../../java/nio/ReadOnlyBufferException.html" title="class in java.nio">ReadOnlyBufferException</A></CODE> - If this buffer is read-only</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="getLong(int)"><!-- --></A><H3>
+getLong</H3>
+<PRE>
+public abstract long <B>getLong</B>(int&nbsp;index)</PRE>
+<DL>
+<DD>Absolute <i>get</i> method for reading a long value.
+
+ <p> Reads eight bytes at the given index, composing them into a
+ long value according to the current byte order.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>index</CODE> - The index from which the bytes will be read
+<DT><B>Returns:</B><DD>The long value at the given index
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/lang/IndexOutOfBoundsException.html" title="class in java.lang">IndexOutOfBoundsException</A></CODE> - If <tt>index</tt> is negative
+          or not smaller than the buffer's limit,
+          minus seven</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="putLong(int, long)"><!-- --></A><H3>
+putLong</H3>
+<PRE>
+public abstract <A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A> <B>putLong</B>(int&nbsp;index,
+                                   long&nbsp;value)</PRE>
+<DL>
+<DD>Absolute <i>put</i> method for writing a long
+ value&nbsp;&nbsp;<i>(optional operation)</i>.
+
+ <p> Writes eight bytes containing the given long value, in the
+ current byte order, into this buffer at the given index.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>index</CODE> - The index at which the bytes will be written<DD><CODE>value</CODE> - The long value to be written
+<DT><B>Returns:</B><DD>This buffer
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/lang/IndexOutOfBoundsException.html" title="class in java.lang">IndexOutOfBoundsException</A></CODE> - If <tt>index</tt> is negative
+          or not smaller than the buffer's limit,
+          minus seven
+<DD><CODE><A HREF="../../java/nio/ReadOnlyBufferException.html" title="class in java.nio">ReadOnlyBufferException</A></CODE> - If this buffer is read-only</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="asLongBuffer()"><!-- --></A><H3>
+asLongBuffer</H3>
+<PRE>
+public abstract <A HREF="../../java/nio/LongBuffer.html" title="class in java.nio">LongBuffer</A> <B>asLongBuffer</B>()</PRE>
+<DL>
+<DD>Creates a view of this byte buffer as a long buffer.
+
+ <p> The content of the new buffer will start at this buffer's current
+ position.  Changes to this buffer's content will be visible in the new
+ buffer, and vice versa; the two buffers' position, limit, and mark
+ values will be independent.
+
+ <p> The new buffer's position will be zero, its capacity and its limit
+ will be the number of bytes remaining in this buffer divided by
+ eight, and its mark will be undefined.  The new buffer will be direct
+ if, and only if, this buffer is direct, and it will be read-only if, and
+ only if, this buffer is read-only.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+
+<DT><B>Returns:</B><DD>A new long buffer</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="getFloat()"><!-- --></A><H3>
+getFloat</H3>
+<PRE>
+public abstract float <B>getFloat</B>()</PRE>
+<DL>
+<DD>Relative <i>get</i> method for reading a float value.
+
+ <p> Reads the next four bytes at this buffer's current position,
+ composing them into a float value according to the current byte order,
+ and then increments the position by four.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+
+<DT><B>Returns:</B><DD>The float value at the buffer's current position
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/nio/BufferUnderflowException.html" title="class in java.nio">BufferUnderflowException</A></CODE> - If there are fewer than four bytes
+          remaining in this buffer</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="putFloat(float)"><!-- --></A><H3>
+putFloat</H3>
+<PRE>
+public abstract <A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A> <B>putFloat</B>(float&nbsp;value)</PRE>
+<DL>
+<DD>Relative <i>put</i> method for writing a float
+ value&nbsp;&nbsp;<i>(optional operation)</i>.
+
+ <p> Writes four bytes containing the given float value, in the
+ current byte order, into this buffer at the current position, and then
+ increments the position by four.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>value</CODE> - The float value to be written
+<DT><B>Returns:</B><DD>This buffer
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/nio/BufferOverflowException.html" title="class in java.nio">BufferOverflowException</A></CODE> - If there are fewer than four bytes
+          remaining in this buffer
+<DD><CODE><A HREF="../../java/nio/ReadOnlyBufferException.html" title="class in java.nio">ReadOnlyBufferException</A></CODE> - If this buffer is read-only</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="getFloat(int)"><!-- --></A><H3>
+getFloat</H3>
+<PRE>
+public abstract float <B>getFloat</B>(int&nbsp;index)</PRE>
+<DL>
+<DD>Absolute <i>get</i> method for reading a float value.
+
+ <p> Reads four bytes at the given index, composing them into a
+ float value according to the current byte order.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>index</CODE> - The index from which the bytes will be read
+<DT><B>Returns:</B><DD>The float value at the given index
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/lang/IndexOutOfBoundsException.html" title="class in java.lang">IndexOutOfBoundsException</A></CODE> - If <tt>index</tt> is negative
+          or not smaller than the buffer's limit,
+          minus three</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="putFloat(int, float)"><!-- --></A><H3>
+putFloat</H3>
+<PRE>
+public abstract <A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A> <B>putFloat</B>(int&nbsp;index,
+                                    float&nbsp;value)</PRE>
+<DL>
+<DD>Absolute <i>put</i> method for writing a float
+ value&nbsp;&nbsp;<i>(optional operation)</i>.
+
+ <p> Writes four bytes containing the given float value, in the
+ current byte order, into this buffer at the given index.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>index</CODE> - The index at which the bytes will be written<DD><CODE>value</CODE> - The float value to be written
+<DT><B>Returns:</B><DD>This buffer
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/lang/IndexOutOfBoundsException.html" title="class in java.lang">IndexOutOfBoundsException</A></CODE> - If <tt>index</tt> is negative
+          or not smaller than the buffer's limit,
+          minus three
+<DD><CODE><A HREF="../../java/nio/ReadOnlyBufferException.html" title="class in java.nio">ReadOnlyBufferException</A></CODE> - If this buffer is read-only</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="asFloatBuffer()"><!-- --></A><H3>
+asFloatBuffer</H3>
+<PRE>
+public abstract <A HREF="../../java/nio/FloatBuffer.html" title="class in java.nio">FloatBuffer</A> <B>asFloatBuffer</B>()</PRE>
+<DL>
+<DD>Creates a view of this byte buffer as a float buffer.
+
+ <p> The content of the new buffer will start at this buffer's current
+ position.  Changes to this buffer's content will be visible in the new
+ buffer, and vice versa; the two buffers' position, limit, and mark
+ values will be independent.
+
+ <p> The new buffer's position will be zero, its capacity and its limit
+ will be the number of bytes remaining in this buffer divided by
+ four, and its mark will be undefined.  The new buffer will be direct
+ if, and only if, this buffer is direct, and it will be read-only if, and
+ only if, this buffer is read-only.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+
+<DT><B>Returns:</B><DD>A new float buffer</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="getDouble()"><!-- --></A><H3>
+getDouble</H3>
+<PRE>
+public abstract double <B>getDouble</B>()</PRE>
+<DL>
+<DD>Relative <i>get</i> method for reading a double value.
+
+ <p> Reads the next eight bytes at this buffer's current position,
+ composing them into a double value according to the current byte order,
+ and then increments the position by eight.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+
+<DT><B>Returns:</B><DD>The double value at the buffer's current position
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/nio/BufferUnderflowException.html" title="class in java.nio">BufferUnderflowException</A></CODE> - If there are fewer than eight bytes
+          remaining in this buffer</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="putDouble(double)"><!-- --></A><H3>
+putDouble</H3>
+<PRE>
+public abstract <A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A> <B>putDouble</B>(double&nbsp;value)</PRE>
+<DL>
+<DD>Relative <i>put</i> method for writing a double
+ value&nbsp;&nbsp;<i>(optional operation)</i>.
+
+ <p> Writes eight bytes containing the given double value, in the
+ current byte order, into this buffer at the current position, and then
+ increments the position by eight.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>value</CODE> - The double value to be written
+<DT><B>Returns:</B><DD>This buffer
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/nio/BufferOverflowException.html" title="class in java.nio">BufferOverflowException</A></CODE> - If there are fewer than eight bytes
+          remaining in this buffer
+<DD><CODE><A HREF="../../java/nio/ReadOnlyBufferException.html" title="class in java.nio">ReadOnlyBufferException</A></CODE> - If this buffer is read-only</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="getDouble(int)"><!-- --></A><H3>
+getDouble</H3>
+<PRE>
+public abstract double <B>getDouble</B>(int&nbsp;index)</PRE>
+<DL>
+<DD>Absolute <i>get</i> method for reading a double value.
+
+ <p> Reads eight bytes at the given index, composing them into a
+ double value according to the current byte order.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>index</CODE> - The index from which the bytes will be read
+<DT><B>Returns:</B><DD>The double value at the given index
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/lang/IndexOutOfBoundsException.html" title="class in java.lang">IndexOutOfBoundsException</A></CODE> - If <tt>index</tt> is negative
+          or not smaller than the buffer's limit,
+          minus seven</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="putDouble(int, double)"><!-- --></A><H3>
+putDouble</H3>
+<PRE>
+public abstract <A HREF="../../java/nio/ByteBuffer.html" title="class in java.nio">ByteBuffer</A> <B>putDouble</B>(int&nbsp;index,
+                                     double&nbsp;value)</PRE>
+<DL>
+<DD>Absolute <i>put</i> method for writing a double
+ value&nbsp;&nbsp;<i>(optional operation)</i>.
+
+ <p> Writes eight bytes containing the given double value, in the
+ current byte order, into this buffer at the given index.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+<DT><B>Parameters:</B><DD><CODE>index</CODE> - The index at which the bytes will be written<DD><CODE>value</CODE> - The double value to be written
+<DT><B>Returns:</B><DD>This buffer
+<DT><B>Throws:</B>
+<DD><CODE><A HREF="../../java/lang/IndexOutOfBoundsException.html" title="class in java.lang">IndexOutOfBoundsException</A></CODE> - If <tt>index</tt> is negative
+          or not smaller than the buffer's limit,
+          minus seven
+<DD><CODE><A HREF="../../java/nio/ReadOnlyBufferException.html" title="class in java.nio">ReadOnlyBufferException</A></CODE> - If this buffer is read-only</DL>
+</DD>
+</DL>
+<HR>
+
+<A NAME="asDoubleBuffer()"><!-- --></A><H3>
+asDoubleBuffer</H3>
+<PRE>
+public abstract <A HREF="../../java/nio/DoubleBuffer.html" title="class in java.nio">DoubleBuffer</A> <B>asDoubleBuffer</B>()</PRE>
+<DL>
+<DD>Creates a view of this byte buffer as a double buffer.
+
+ <p> The content of the new buffer will start at this buffer's current
+ position.  Changes to this buffer's content will be visible in the new
+ buffer, and vice versa; the two buffers' position, limit, and mark
+ values will be independent.
+
+ <p> The new buffer's position will be zero, its capacity and its limit
+ will be the number of bytes remaining in this buffer divided by
+ eight, and its mark will be undefined.  The new buffer will be direct
+ if, and only if, this buffer is direct, and it will be read-only if, and
+ only if, this buffer is read-only.  </p>
+<P>
+<DD><DL>
+</DL>
+</DD>
+<DD><DL>
+
+<DT><B>Returns:</B><DD>A new double buffer</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>&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/ByteBuffer.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-files/index-1.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>
+<b>Java<sup><font size=-2>TM</font></sup>&nbsp;2&nbsp;Platform<br>Standard&nbsp;Ed. 5.0</b></EM>
+</TD>
+</TR>
+
+<TR>
+<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
+&nbsp;<A HREF="../../java/nio/BufferUnderflowException.html" title="class in java.nio"><B>PREV CLASS</B></A>&nbsp;
+&nbsp;<A HREF="../../java/nio/ByteOrder.html" title="class in java.nio"><B>NEXT CLASS</B></A></FONT></TD>
+<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
+  <A HREF="../../index.html?java/nio/ByteBuffer.html" target="_top"><B>FRAMES</B></A>  &nbsp;
+&nbsp;<A HREF="ByteBuffer.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;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
+<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
+DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&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="http://java.sun.com/cgi-bin/bugreport.cgi">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="../../../relnotes/devdocs-vs-specs.html">Java 2 SDK SE Developer Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. <p>Copyright 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to <a href="../../../relnotes/license.html">license terms</a>. Also see the <a href="http://java.sun.com/docs/redist.html">documentation redistribution policy</a>.</font>
+</BODY>
+<script language="JavaScript" src="/js/omi/jsc/s_code_remote.js"></script></HTML>

Modified: sandbox/trunk/hotbuffer/test_hotbuf.py
==============================================================================
--- sandbox/trunk/hotbuffer/test_hotbuf.py	(original)
+++ sandbox/trunk/hotbuffer/test_hotbuf.py	Sat May 27 11:58:13 2006
@@ -9,17 +9,21 @@
 from hotbuf import hotbuf, BoundaryError
 from struct import Struct
 import unittest
+from cStringIO import StringIO
 from test import test_support
 
-
 CAPACITY = 1024
 MSG = 'Martin Blais was here scribble scribble.'
-# Note: we don't use floats because comparisons will cause precision errors due
-# to the binary conversion.
-fmt = Struct('llci')
 
+
+#------------------------------------------------------------------------
+#
 class HotbufTestCase(unittest.TestCase):
 
+    # Note: we don't use floats because comparisons will cause precision
+    # errors due to the binary conversion.
+    fmt = Struct('llci')
+
     def test_base( self ):
         # Create a new hotbuf
         self.assertRaises(ValueError, hotbuf, -1)
@@ -112,7 +116,7 @@
         b.compact()
         self.assertEquals((b.position, b.limit, b.mark_position),
                           (100, CAPACITY, -1))
-        
+
         # Compare the text that gets compacted.
         b.clear()
         b.setposition(100)
@@ -151,11 +155,11 @@
 
         # Read back and assert message
         self.assertEquals(b.getstr(len(MSG)), MSG)
-        
+
         # Test overflow.
         b.flip()
         self.assertRaises(BoundaryError, b.putstr, ' ' * 1000)
-        
+
         # Test underflow.
         self.assertRaises(BoundaryError, b.getstr, 1000)
 
@@ -165,7 +169,7 @@
         b.flip()
         s = b.getstr()
         self.assertEquals(s, MSG)
-        
+
     def test_conversion( self ):
         b = hotbuf(CAPACITY)
 
@@ -178,31 +182,31 @@
 
         r = repr(b)
         self.assert_(r.startswith('<hotbuf '))
-        
+
     def test_compare( self ):
         b = hotbuf(CAPACITY)
 
     def test_pack( self ):
         ARGS = 42, 16, '@', 3
         # Pack to a string.
-        s = fmt.pack(*ARGS)
+        s = self.fmt.pack(*ARGS)
 
         # Pack directly into the buffer and compare the strings.
         b = hotbuf(CAPACITY)
-        fmt.pack_to(b, 0, *ARGS)
+        self.fmt.pack_to(b, 0, *ARGS)
         b.setlimit(len(s))
         self.assertEquals(str(b), s)
 
     def test_pack_method(self):
         ARGS = 42, 16, '@', 3
         # Pack to a string.
-        s = fmt.pack(*ARGS)
+        s = self.fmt.pack(*ARGS)
 
         # Pack directly into the buffer and compare the strings.
         b = hotbuf(CAPACITY)
         b.setlimit(len(s))
-        b.pack(fmt, *ARGS)
-        self.assertEquals(b.position, fmt.size)
+        b.pack(self.fmt, *ARGS)
+        self.assertEquals(b.position, self.fmt.size)
         b.flip()
         self.assertEquals(str(b), s)
 
@@ -211,25 +215,25 @@
         b = hotbuf(CAPACITY)
 
         # Pack normally and put that string in the buffer.
-        s = fmt.pack(*ARGS)
+        s = self.fmt.pack(*ARGS)
         b.putstr(s)
 
         # Unpack directly from the buffer and compare.
         b.flip()
-        self.assertEquals(fmt.unpack_from(b), ARGS)
+        self.assertEquals(self.fmt.unpack_from(b), ARGS)
 
     def test_unpack_method( self ):
         ARGS = 42, 16, '@', 3
         b = hotbuf(CAPACITY)
 
         # Pack normally and put that string in the buffer.
-        s = fmt.pack(*ARGS)
+        s = self.fmt.pack(*ARGS)
         b.putstr(s)
 
         # Unpack directly from the buffer and compare.
         b.flip()
-        self.assertEquals(b.unpack(fmt), ARGS)
-        self.assertEquals(b.position, fmt.size)
+        self.assertEquals(b.unpack(self.fmt), ARGS)
+        self.assertEquals(b.position, self.fmt.size)
 
     def test_zerolen( self ):
         b = hotbuf(CAPACITY)
@@ -261,7 +265,7 @@
         self.assertEquals(b.count('ab'), 0)
         self.assertEquals(b.count('d'), 3)
         self.assertEquals(b.count('1' * 100), 0)
-    
+
     def test_find(self):
         b = hotbuf(CAPACITY)
         b.putstr('abcddddd')
@@ -294,8 +298,366 @@
         self.assertEquals(bool(b), False)
 
 
+#------------------------------------------------------------------------
+#
+class HotbufUseCases(unittest.TestCase):
+    """
+    Use cases for the hot buffer.
+
+    This is not so much a test but a demonstration of how to implement
+    common patterns of parsing using the hot buffer.  We're trying to
+    come up with the typical use cases for this kind of object, in order
+    to design this buffer object as efficiently as possible.  Once this
+    is done, we will implement some of these common patterns in C, as
+    generically as possible (e.g. for parsing netstrings faster).
+
+    We need to be able to parse
+
+    - line-based protocols
+    - netstring protocols
+    - work with multiple sockets
+
+    as efficiently as possible.
+
+    We're not entirely sure of the interface that this class should have
+    here so we spell out all the operations, assuming that the hot buffer
+    only contains a position and a limit, and that this limits which
+    region is accessible to get contents out of it.
+
+    The hot buffer is an fixed size buffer that contains a position and a
+    limit:
+
+       X-----------X-----------------X-------------------------X
+       0           position          limit                     capacity
+
+    Where the following invariant always holds:
+
+          0 <= position <= limit <= capacity
+
+    The hot buffer supports the buffer protocol, and exposes only the
+    region between position and limit.
+
+
+    The following basic operations are assumed available (we may provide
+    combinations of those for common occurrences if needed):
+
+    - reading and setting the position of the hot buffer
+
+    - reading and setting the limit of the hot buffer
+
+    - compact(): move the contents to the beginning of the buffer and
+                 prepare to read more
+
+        copy [hot.position, hot.limit] to location 0
+        hot.position = hot.limit - hot.position
+        hot.limit = hot.capacity
+
+    - flip(): flip the active region to the beginning part
+
+        hot.limit = hot.position
+        hot.position = 0
+
+    - getbyte():
+
+        c = buf[self.position]
+        self.position += 1
+        return c
+
+    - getbyte(relpos):
+
+        c = buf[self.position]
+        return c
+
+    - getstr():
+
+        s = buf[self.position:self.limit]
+        self.position self.limit
+        return s
+
+    - putstr(s):
+
+        buf += s
+        self.position += len(s)
+
+    Note: these codes are not exception-safe in terms of the buffer's
+    position and limit, i.e. if there is an exception, the position and
+    limit will not be reset correctly unless you do so, or, well, to
+    their previous value--whether that is correct or incorrect depends
+    on your application and the side-effects that may have occurred.
+    """
+
+    data1 = """
+Most programming languages, including Lisp, are organized
+around computing the values of mathematical
+functions. Expression-oriented languages (such as Lisp,
+Fortran, and Algol) capitalize on the ``pun'' that an
+expression that describes the value of a function may also
+be interpreted as a means of computing that value. Because
+of this, most programming languages are strongly biased
+toward unidirectional computations (computations with
+well-defined inputs and outputs). There are, however,
+radically different programming languages that relax this
+bias. We saw one such example in section 3.3.5, where the
+objects of computation were arithmetic constraints. In a
+constraint system the direction and the order of
+computation are not so well specified; in carrying out a
+computation the system must therefore provide more detailed
+``how to'' knowledge than would be the case with an
+ordinary arithmetic computation.
+
+This does not mean, however, that the user is released
+altogether from the responsibility of providing imperative
+knowledge. There are many constraint networks that
+implement the same set of constraints, and the user must
+choose from the set of mathematically equivalent networks a
+suitable network to specify a particular computation.
+
+"""
+    lines1 = map(str.strip, data1.splitlines())
+
+    def parse_newline_delim( self, hot, read, process_line ):
+        """
+        Use case for newline-delimited data.
+        """
+        # Initiallly put some data into the buffer.
+        hot.putstr(read(len(hot)))
+
+        # Look over the entire input.
+        while 1:
+            # Save the current position and limit
+            abslimit = hot.limit
+            mark_position = hot.position # setmark
+
+            # Loop over the current buffer contents
+            while hot:
+                # Save the starting position
+                start = hot.position
+
+## FIXME we need to replace what follows by the hot.find method, the
+## overhead of funcall for every char is too high
+
+                # Loop over all characters
+                while 1:
+                    # If we got to the end of the line
+                    if hot.getbyte() == '\n':
+                        # Process the line we found
+
+                        # Calculate how much characters are needed to
+                        # backup to remove the EOL marker
+                        end = hot.position
+                        backup = 1
+                        # Make sure we don't look before the first char
+                        if end - start > 1:
+                            if hot.getbyte(end - 2) == '\r':
+                                backup = 2
+
+                        # Restrict the window to the current line
+                        hot.position = mark_position # reset
+                        hot.limit = end - backup
+
+                        # Process the line.
+                        process_line(hot)
+
+                        # Advance the buffer window to the rest of the
+                        # buffer after the line
+                        mark_position = hot.position = end
+                        hot.limit(abslimit)
+
+                        break
+
+                    # If the buffer is empty, get out
+                    if not hot:
+                        break
+
+            # Set the position to the last marker
+            hot.position = mark_position # reset
+
+            # Read more data in the buffer.
+## FIXME: we need to support reading from a file directly into the
+## buffer.
+            hot.compact()
+            s = read(len(hot))
+            if not s:
+                break # Finished the input, exit.
+            hot.putstr(s)
+
+    def test_newline_delim_data( self ):
+        """
+        Test for newline-delimited data.
+        """
+        inp = StringIO(self.data1)
+        hot = hotbuf(CAPACITY)
+
+        lineidx = [0]
+        def assert_lines( hot ):
+            "Assert the lines we process are the ones we expect."
+            print hot
+            self.assertEquals(hot, self.lines1[lineidx[0]])
+            lineidx[0] += 1
+
+        self.parse_newline_delim(hot, inp.read, assert_lines)
+
+
+#------------------------------------------------------------------------
+#
+    def _test_netstrings( self ):
+        """
+        Use case for netstrings.
+        """
+
+        # Loop over the entire input.
+        while 1:
+            # Save the current limit.
+            abslimit = hot.limit
+
+            # Loop over all the messages in the current buffer.
+            while hot:
+                # Read the length and parse the message.
+                length = hot.getbyte() # No error can occur here, since we're
+                                       # still hot.
+                if len(hot) < length:
+                    # Rollback the length byte and exit the loop to fill
+                    # the buffer with new data.
+                    hot.position -= 1 # advance(-1)
+                    break
+
+                # Window around the message content.
+                limit = hot.limit = hot.position + length
+
+                # Parse the message.
+                #
+                # - We are insured to be able to read all the message
+                #   here because we checked for the length.
+                # - Exceptions will be programming errors.
+                # - You never need to deal with rollback of your transactions.
+
+                process_message(hot)
+
+                # Advance beyond the message.
+                hot.position = limit
+                hot.limit = abslimit
+
+            # Compact and read the next chunk of the buffer.
+            hot.compact()
+            s = read(len(hot))
+            if not s:
+                break # Finished the input, exit.
+
+## FIXME review the version with exceptions, would it be faster to just
+## hit the boundary?  I would prefer letting the boundary be
+
+        while 1:
+            # Catch when we hit the boundary.
+            try:
+                # Loop over all the messages in the current buffer.
+                while hot:
+                    # Read the length.
+                    length = hot.getbyte() # This never raises since
+                                           # we're hot.
+
+                    mark_position = hot.position
+                    mark_limit = hot.limit
+                    hot.limit = hot.position + length
+                    saved = True
+
+                    # Parse the message.
+                    #
+                    # - We are insured to be able to read all the message
+                    #   here because we checked for the length.
+                    # - Exceptions will be programming errors.
+                    # - You never need to deal with rollback of your
+                    #   transactions.
+
+                    process_message(hot)
+
+                    # Pop the message window and advance beyond the
+                    # length.
+                    hot.position = hot.limit
+                    saved = False
+                else:
+                    # Raise an exception, triggering a filling of the
+                    # buffer
+                    raise hotbuf.BoundaryError
+
+            except hotbuf.BoundaryError:
+                # Rollback the failed transaction, if there was one.
+                if saved:
+                    hot.position = mark_position
+                    hot.limit = mark_limit
+
+                # Compact and read the next chunk of the buffer.
+                hot.compact()
+                s = read(len(hot))
+                if not s:
+                    break # Finished the input, exit.
+
+
+
+
+    def _test_detect_boundary( self ):
+        """
+        Use case for arbitraty formats, where we do not set a limit for
+        the processing window, and where attempting to get bytes outside
+        the boundary will result in getting more data from the input.
+
+        This implies that the processing code should be able to rollback
+        and prepare to reprocess a partially processed item in case this
+        happens.
+        """
+
+        while 1:
+            # Catch when we hit the boundary.
+            try:
+                # Loop over all the messages in the current buffer.
+                while hot:
+                    # Save the current window in case of error
+                    mark_position = hot.position
+                    mark_limit = hot.limit
+                    saved = True
+
+                    # Parse the message.
+                    #
+                    # - We are insured to be able to read all the message
+                    #   here because we checked for the length.
+                    # - Exceptions will be programming errors.
+                    # - You never need to deal with rollback of your
+                    #   transactions.
+
+                    # (your code)
+
+                    # Pop the saved window
+                else:
+                    raise hotbuf.BoundaryError
+
+            except hotbuf.BoundaryError:
+                # Rollback the failed transaction, if there was one.
+                if saved:
+                    hot.position = mark_position
+                    hot.limit = mark_limit
+
+                # Compact and read the next chunk of the buffer.
+                hot.compact()
+                s = read(len(hot))
+                if not s:
+                    break # Finished the input, exit.
+
+    def _test_multiple_sockets( self ):
+        """
+        Use case for an event-based dispatcher, that may read its input
+        from multiple sockets.
+        """
+## FIXME TODO
+
+
+
+
+
+
+#------------------------------------------------------------------------
+#
 def test_main():
     test_support.run_unittest(HotbufTestCase)
+    #test_support.run_unittest(HotbufUseCases)
 
 if __name__ == "__main__":
     test_main()

Deleted: /sandbox/trunk/hotbuffer/use_cases.py
==============================================================================
--- /sandbox/trunk/hotbuffer/use_cases.py	Sat May 27 11:58:13 2006
+++ (empty file)
@@ -1,120 +0,0 @@
-#!/usr/bin/env python
-
-"""
-Use cases for the hot buffer.
-"""
-
-
-#-------------------------------------------------------------------------------
-# Case 1: parsing netstrings, not using exceptions.
-
-    # Loop over the entire input.
-    while 1:
-        # Loop over all the messages in the current buffer.
-        while hot:
-            # Read the length and parse the message.
-            length = hot.getbyte() # No error can occur here, since we're
-                                   # still hot.
-            if len(hot) < length:
-                # Rollback the length byte and exit the loop to fill the buffer
-                # with new data.
-                hot.advance(-1)
-                break
-
-            # Save the current window and window around the message content.
-            hot.push(1, length)
-
-            # Parse the message.
-            #
-            # - We are insured to be able to read all the message here because
-            #   we checked for the length.
-            # - Exceptions will be programming errors.
-            # - You never need to deal with rollback of your transactions.
-
-            # (your code)
-
-            # Pop the message window and advance beyond the length.
-            hot.pop()
-            hot.advance(length + 1)
-
-        # Compact and read the next chunk of the buffer.
-        hot.compact()
-        s = read(len(hot))
-        if not s:
-            break # Finished the input, exit.
-
-#-------------------------------------------------------------------------------
-# Case 2: parsing netstrings, using exceptions.  This is more or less the same
-# as Case 1, but without checking the length from Python, but the length is
-# automatically checked by push().
-
-    while 1:
-        # Catch when we hit the boundary.
-        try:
-            # Loop over all the messages in the current buffer.
-            while hot:
-                # Read the length.
-                length = hot.getbyte()  # This may raise
-                hot.push(1, length)     # This may raise as well
-
-                # Parse the message.
-                #
-                # - We are insured to be able to read all the message here
-                #   because we checked for the length.
-                # - Exceptions will be programming errors.
-                # - You never need to deal with rollback of your transactions.
-
-                # (your code)
-
-                # Pop the message window and advance beyond the length.
-                hot.pop()
-                hot.advance(length + 1)
-            else:
-                raise hotbuf.BoundaryError
-            
-        except hotbuf.BoundaryError:
-            # Rollback the failed transaction.
-            hot.pop()
-
-            # Compact and read the next chunk of the buffer.
-            hot.compact()
-            s = read(len(hot))
-            if not s:
-                break # Finished the input, exit.
-
-#-------------------------------------------------------------------------------
-# Case 3: arbitrary formats, may hit the boundary, cannot detect programming
-# errors.
-
-    while 1:
-        # Catch when we hit the boundary.
-        try:
-            # Loop over all the messages in the current buffer.
-            while hot:
-                hot.push()
-
-                # Parse the message.
-                #
-                # - We are insured to be able to read all the message here
-                #   because we checked for the length.
-                # - Exceptions will be programming errors.
-                # - You never need to deal with rollback of your transactions.
-
-                # (your code)
-
-                # Pop the safe window and leave the current position and limit
-                # alone.
-                hot.pop(False)
-            else:
-                raise hotbuf.BoundaryError
-
-        except hotbuf.BoundaryError:
-            # Rollback the failed transaction.
-            hot.pop()
-
-            # Compact and read the next chunk of the buffer.
-            hot.compact()
-            s = read(len(hot))
-            if not s:
-                break # Finished the input, exit.
-


More information about the Python-checkins mailing list