Java Doc for IoBuffer.java in  » Net » mina-2.0.0-M1 » org » apache » mina » common » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Net » mina 2.0.0 M1 » org.apache.mina.common 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.mina.common.IoBuffer

All known Subclasses:   org.apache.mina.common.AbstractIoBuffer,  org.apache.mina.common.IoBufferWrapper,
IoBuffer
abstract public class IoBuffer implements Comparable<IoBuffer>(Code)
A byte buffer used by MINA applications.

This is a replacement for ByteBuffer . Please refer to ByteBuffer documentation for preliminary usage. MINA does not use NIO ByteBuffer directly for two reasons:

  • It doesn't provide useful getters and putters such as fill, get/putString, and get/putAsciiInt() enough.
  • It is difficult to write variable-length data due to its fixed capacity

Allocation

You can allocate a new heap buffer.

 IoBuffer buf = IoBuffer.allocate(1024, false);
 
you can also allocate a new direct buffer:
 IoBuffer buf = IoBuffer.allocate(1024, true);
 
or you can set the default buffer type.
 // Allocate heap buffer by default.
 IoBuffer.setUseDirectBuffer(false);
 // A new heap buffer is returned.
 IoBuffer buf = IoBuffer.allocate(1024);
 

Wrapping existing NIO buffers and arrays

This class provides a few wrap(...) methods that wraps any NIO buffers and byte arrays.

AutoExpand

Writing variable-length data using NIO ByteBuffers is not really easy, and it is because its size is fixed. IoBuffer introduces autoExpand property. If autoExpand property is true, you never get BufferOverflowException or IndexOutOfBoundsException (except when index is negative). It automatically expands its capacity and limit value. For example:

 String greeting = messageBundle.getMessage( "hello" );
 IoBuffer buf = IoBuffer.allocate( 16 );
 // Turn on autoExpand (it is off by default)
 buf.setAutoExpand( true );
 buf.putString( greeting, utf8encoder );
 
The underlying ByteBuffer is reallocated by IoBuffer behind the scene if the encoded data is larger than 16 bytes in the example above. Its capacity will double, and its limit will increase to the last position the string is written.

AutoShrink

You might also want to decrease the capacity of the buffer when most of the allocated memory area is not being used. IoBuffer provides autoShrink property to take care of this issue. If autoShrink is turned on, IoBuffer halves the capacity of the buffer when IoBuffer.compact() is invoked and only 1/4 or less of the current capacity is being used.

You can also IoBuffer.shrink() method manually to shrink the capacity of the buffer.

The underlying ByteBuffer is reallocated by IoBuffer behind the scene, and therefore IoBuffer.buf() will return a different ByteBuffer instance once capacity changes. Please also note IoBuffer.compact() or IoBuffer.shrink() will not decrease the capacity if the new capacity is less than the IoBuffer.minimumCapacity() of the buffer.

Derived Buffers

Derived buffers are the buffers which were created by IoBuffer.duplicate() , IoBuffer.slice() , or IoBuffer.asReadOnlyBuffer() . They are useful especially when you broadcast the same messages to multiple IoSession s. Please note that the buffer derived from and its derived buffers are not both auto-expandable neither auto-shrinkable. Trying to call IoBuffer.setAutoExpand(boolean) or IoBuffer.setAutoShrink(boolean) with true parameter will raise an IllegalStateException .

Changing Buffer Allocation Policy

IoBufferAllocator interface lets you override the default buffer management behavior. There are two allocators provided out-of-the-box:

You can implement your own allocator and use it by calling IoBuffer.setAllocator(IoBufferAllocator) .


author:
   The Apache MINA Project (dev@mina.apache.org)
version:
   $Rev: 602109 $, $Date: 2007-12-07 07:40:41 -0700 (Fri, 07 Dec 2007) $


Field Summary
final public static  IoBufferEMPTY_BUFFER
     An immutable empty buffer.
final protected static  Set<String>primitiveTypeNames
    

Constructor Summary
protected  IoBuffer()
     Creates a new instance.

Method Summary
public static  IoBufferallocate(int capacity)
     Returns the direct or heap buffer which is capable to store the specified amount of bytes.
public static  IoBufferallocate(int capacity, boolean direct)
     Returns the buffer which is capable of the specified size.
abstract public  byte[]array()
    
abstract public  intarrayOffset()
    
abstract public  CharBufferasCharBuffer()
    
abstract public  DoubleBufferasDoubleBuffer()
    
abstract public  FloatBufferasFloatBuffer()
    
abstract public  InputStreamasInputStream()
     Returns an InputStream that reads the data from this buffer.
abstract public  IntBufferasIntBuffer()
    
abstract public  LongBufferasLongBuffer()
    
abstract public  OutputStreamasOutputStream()
     Returns an OutputStream that appends the data into this buffer. Please note that the OutputStream.write(int) will throw a BufferOverflowException instead of an IOException in case of buffer overflow.
abstract public  IoBufferasReadOnlyBuffer()
    
abstract public  ShortBufferasShortBuffer()
    
abstract public  ByteBufferbuf()
     Returns the underlying NIO buffer instance.
abstract public  intcapacity()
    
abstract public  IoBuffercapacity(int newCapacity)
     Increases the capacity of this buffer.
abstract public  IoBufferclear()
    
abstract public  IoBuffercompact()
    
abstract public  IoBufferduplicate()
    
abstract public  IoBufferexpand(int expectedRemaining)
     Changes the capacity and limit of this buffer so this buffer get the specified expectedRemaining room from the current position.
abstract public  IoBufferexpand(int position, int expectedRemaining)
     Changes the capacity and limit of this buffer so this buffer get the specified expectedRemaining room from the specified position.
abstract public  IoBufferfill(byte value, int size)
     Fills this buffer with the specified value.
abstract public  IoBufferfill(int size)
     Fills this buffer with NUL (0x00).
abstract public  IoBufferfillAndReset(byte value, int size)
     Fills this buffer with the specified value.
abstract public  IoBufferfillAndReset(int size)
     Fills this buffer with NUL (0x00).
abstract public  IoBufferflip()
    
abstract public  voidfree()
     Declares this buffer and all its derived buffers are not used anymore so that it can be reused by some IoBufferAllocator implementations. It is not mandatory to call this method, but you might want to invoke this method for maximum performance.
abstract public  byteget()
    
abstract public  byteget(int index)
    
abstract public  IoBufferget(byte[] dst, int offset, int length)
    
abstract public  IoBufferget(byte[] dst)
    
public static  IoBufferAllocatorgetAllocator()
    
abstract public  chargetChar()
    
abstract public  chargetChar(int index)
    
abstract public  doublegetDouble()
    
abstract public  doublegetDouble(int index)
    
abstract public  EgetEnum(Class<E> enumClass)
     Reads a byte from the buffer and returns the correlating enum constant defined by the specified enum type.
abstract public  EgetEnum(int index, Class<E> enumClass)
     Reads a byte from the buffer and returns the correlating enum constant defined by the specified enum type.
abstract public  EgetEnumInt(Class<E> enumClass)
     Reads an int from the buffer and returns the correlating enum constant defined by the specified enum type.
abstract public  EgetEnumInt(int index, Class<E> enumClass)
     Reads an int from the buffer and returns the correlating enum constant defined by the specified enum type.
abstract public  EnumSet<E>getEnumSet(Class<E> enumClass)
     Reads a byte sized bit vector and converts it to an EnumSet .

Each bit is mapped to a value in the specified enum.

abstract public  EnumSet<E>getEnumSet(int index, Class<E> enumClass)
     Reads a byte sized bit vector and converts it to an EnumSet .
abstract public  EnumSet<E>getEnumSetInt(Class<E> enumClass)
     Reads an int sized bit vector and converts it to an EnumSet .
abstract public  EnumSet<E>getEnumSetInt(int index, Class<E> enumClass)
     Reads an int sized bit vector and converts it to an EnumSet .
abstract public  EnumSet<E>getEnumSetLong(Class<E> enumClass)
     Reads a long sized bit vector and converts it to an EnumSet .
abstract public  EnumSet<E>getEnumSetLong(int index, Class<E> enumClass)
     Reads a long sized bit vector and converts it to an EnumSet .
abstract public  EnumSet<E>getEnumSetShort(Class<E> enumClass)
     Reads a short sized bit vector and converts it to an EnumSet .
abstract public  EnumSet<E>getEnumSetShort(int index, Class<E> enumClass)
     Reads a short sized bit vector and converts it to an EnumSet .
abstract public  EgetEnumShort(Class<E> enumClass)
     Reads a short from the buffer and returns the correlating enum constant defined by the specified enum type.
abstract public  EgetEnumShort(int index, Class<E> enumClass)
     Reads a short from the buffer and returns the correlating enum constant defined by the specified enum type.
abstract public  floatgetFloat()
    
abstract public  floatgetFloat(int index)
    
abstract public  StringgetHexDump()
     Returns hexdump of this buffer.
abstract public  StringgetHexDump(int lengthLimit)
     Return hexdump of this buffer with limited length.
abstract public  intgetInt()
    
abstract public  intgetInt(int index)
    
abstract public  longgetLong()
    
abstract public  longgetLong(int index)
    
abstract public  intgetMediumInt()
     Relative get method for reading a medium int value.
abstract public  intgetMediumInt(int index)
     Absolute get method for reading a medium int value.
abstract public  ObjectgetObject()
     Reads a Java object from the buffer using the context ClassLoader of the current thread.
abstract public  ObjectgetObject(ClassLoader classLoader)
     Reads a Java object from the buffer using the specified classLoader.
abstract public  StringgetPrefixedString(CharsetDecoder decoder)
     Reads a string which has a 16-bit length field before the actual encoded string, using the specified decoder and returns it.
abstract public  StringgetPrefixedString(int prefixLength, CharsetDecoder decoder)
     Reads a string which has a length field before the actual encoded string, using the specified decoder and returns it.
abstract public  shortgetShort()
    
abstract public  shortgetShort(int index)
    
abstract public  IoBuffergetSlice(int index, int length)
     TODO document me.
abstract public  IoBuffergetSlice(int length)
     TODO document me.
abstract public  StringgetString(CharsetDecoder decoder)
     Reads a NUL-terminated string from this buffer using the specified decoder and returns it.
abstract public  StringgetString(int fieldSize, CharsetDecoder decoder)
     Reads a NUL-terminated string from this buffer using the specified decoder and returns it.
abstract public  shortgetUnsigned()
     Reads one unsigned byte as a short integer.
abstract public  shortgetUnsigned(int index)
     Reads one byte as an unsigned short integer.
abstract public  longgetUnsignedInt()
     Reads four bytes unsigned integer.
abstract public  longgetUnsignedInt(int index)
     Reads four bytes unsigned integer.
abstract public  intgetUnsignedMediumInt()
     Relative get method for reading an unsigned medium int value.
abstract public  intgetUnsignedMediumInt(int index)
     Absolute get method for reading an unsigned medium int value.
abstract public  intgetUnsignedShort()
     Reads two bytes unsigned integer.
abstract public  intgetUnsignedShort(int index)
     Reads two bytes unsigned integer.
abstract public  booleanhasArray()
    
abstract public  booleanhasRemaining()
    
abstract public  intindexOf(byte b)
     Returns the first occurence position of the specified byte from the current position to the current limit.
abstract public  booleanisAutoExpand()
     Returns true if and only if autoExpand is turned on.
abstract public  booleanisAutoShrink()
     Returns true if and only if autoShrink is turned on.
abstract public  booleanisDerived()
     returns true if and only if this buffer is derived from other buffer via IoBuffer.duplicate() , IoBuffer.slice() or IoBuffer.asReadOnlyBuffer() .
abstract public  booleanisDirect()
    
abstract public  booleanisReadOnly()
    
public static  booleanisUseDirectBuffer()
     Returns true if and only if a direct buffer is allocated by default when the type of the new buffer is not specified.
abstract public  intlimit()
    
abstract public  IoBufferlimit(int newLimit)
    
abstract public  IoBuffermark()
    
abstract public  intmarkValue()
     Returns the position of the current mark.
abstract public  intminimumCapacity()
     Returns the minimum capacity of this buffer which is used to determine the new capacity of the buffer shrunk by IoBuffer.compact() and IoBuffer.shrink() operation.
abstract public  IoBufferminimumCapacity(int minimumCapacity)
     Sets the minimum capacity of this buffer which is used to determine the new capacity of the buffer shrunk by IoBuffer.compact() and IoBuffer.shrink() operation.
protected static  intnormalizeCapacity(int requestedCapacity)
     Normalizes the specified capacity of the buffer to power of 2, which is often helpful for optimal memory usage and performance.
abstract public  ByteOrderorder()
    
abstract public  IoBufferorder(ByteOrder bo)
    
abstract public  intposition()
    
abstract public  IoBufferposition(int newPosition)
    
abstract public  booleanprefixedDataAvailable(int prefixLength)
     Returns true if this buffer contains a data which has a data length as a prefix and the buffer has remaining data as enough as specified in the data length field.
abstract public  booleanprefixedDataAvailable(int prefixLength, int maxDataLength)
     Returns true if this buffer contains a data which has a data length as a prefix and the buffer has remaining data as enough as specified in the data length field.
abstract public  IoBufferput(byte b)
    
abstract public  IoBufferput(int index, byte b)
    
abstract public  IoBufferput(ByteBuffer src)
     Writes the content of the specified src into this buffer.
abstract public  IoBufferput(IoBuffer src)
     Writes the content of the specified src into this buffer.
abstract public  IoBufferput(byte[] src, int offset, int length)
    
abstract public  IoBufferput(byte[] src)
    
abstract public  IoBufferputChar(char value)
    
abstract public  IoBufferputChar(int index, char value)
    
abstract public  IoBufferputDouble(double value)
    
abstract public  IoBufferputDouble(int index, double value)
    
abstract public  IoBufferputEnum(Enum e)
     Writes an enum's ordinal value to the buffer as a byte.
abstract public  IoBufferputEnum(int index, Enum e)
     Writes an enum's ordinal value to the buffer as a byte.
abstract public  IoBufferputEnumInt(Enum e)
     Writes an enum's ordinal value to the buffer as an integer.
abstract public  IoBufferputEnumInt(int index, Enum e)
     Writes an enum's ordinal value to the buffer as an integer.
abstract public  IoBufferputEnumSet(Set<E> set)
     Writes the specified Set to the buffer as a byte sized bit vector.
abstract public  IoBufferputEnumSet(int index, Set<E> set)
     Writes the specified Set to the buffer as a byte sized bit vector.
abstract public  IoBufferputEnumSetInt(Set<E> set)
     Writes the specified Set to the buffer as an int sized bit vector.
abstract public  IoBufferputEnumSetInt(int index, Set<E> set)
     Writes the specified Set to the buffer as an int sized bit vector.
abstract public  IoBufferputEnumSetLong(Set<E> set)
     Writes the specified Set to the buffer as a long sized bit vector.
abstract public  IoBufferputEnumSetLong(int index, Set<E> set)
     Writes the specified Set to the buffer as a long sized bit vector.
abstract public  IoBufferputEnumSetShort(Set<E> set)
     Writes the specified Set to the buffer as a short sized bit vector.
abstract public  IoBufferputEnumSetShort(int index, Set<E> set)
     Writes the specified Set to the buffer as a short sized bit vector.
abstract public  IoBufferputEnumShort(Enum e)
     Writes an enum's ordinal value to the buffer as a short.
abstract public  IoBufferputEnumShort(int index, Enum e)
     Writes an enum's ordinal value to the buffer as a short.
abstract public  IoBufferputFloat(float value)
    
abstract public  IoBufferputFloat(int index, float value)
    
abstract public  IoBufferputInt(int value)
    
abstract public  IoBufferputInt(int index, int value)
    
abstract public  IoBufferputLong(long value)
    
abstract public  IoBufferputLong(int index, long value)
    
abstract public  IoBufferputMediumInt(int value)
     Relative put method for writing a medium int value.
abstract public  IoBufferputMediumInt(int index, int value)
     Absolute put method for writing a medium int value.
abstract public  IoBufferputObject(Object o)
     Writes the specified Java object to the buffer.
abstract public  IoBufferputPrefixedString(CharSequence in, CharsetEncoder encoder)
     Writes the content of in into this buffer as a string which has a 16-bit length field before the actual encoded string, using the specified encoder.
abstract public  IoBufferputPrefixedString(CharSequence in, int prefixLength, CharsetEncoder encoder)
     Writes the content of in into this buffer as a string which has a 16-bit length field before the actual encoded string, using the specified encoder.
abstract public  IoBufferputPrefixedString(CharSequence in, int prefixLength, int padding, CharsetEncoder encoder)
     Writes the content of in into this buffer as a string which has a 16-bit length field before the actual encoded string, using the specified encoder.
abstract public  IoBufferputPrefixedString(CharSequence val, int prefixLength, int padding, byte padValue, CharsetEncoder encoder)
     Writes the content of in into this buffer as a string which has a 16-bit length field before the actual encoded string, using the specified encoder.
abstract public  IoBufferputShort(short value)
    
abstract public  IoBufferputShort(int index, short value)
    
abstract public  IoBufferputString(CharSequence val, CharsetEncoder encoder)
     Writes the content of in into this buffer using the specified encoder.
abstract public  IoBufferputString(CharSequence val, int fieldSize, CharsetEncoder encoder)
     Writes the content of in into this buffer as a NUL-terminated string using the specified encoder.
abstract public  intremaining()
    
abstract public  IoBufferreset()
    
abstract public  IoBufferrewind()
    
public static  voidsetAllocator(IoBufferAllocator newAllocator)
    
abstract public  IoBuffersetAutoExpand(boolean autoExpand)
     Turns on or off autoExpand.
abstract public  IoBuffersetAutoShrink(boolean autoShrink)
     Turns on or off autoShrink.
public static  voidsetUseDirectBuffer(boolean useDirectBuffer)
     Sets if a direct buffer should be allocated by default when the type of the new buffer is not specified.
abstract public  IoBuffershrink()
     Changes the capacity of this buffer so this buffer occupies as less memory as possible while retaining the position, limit and the buffer content between the position and limit.
abstract public  IoBufferskip(int size)
     Forwards the position of this buffer as the specified size bytes.
abstract public  IoBufferslice()
    
abstract public  IoBuffersweep()
     Clears this buffer and fills its content with NUL.
abstract public  IoBuffersweep(byte value)
     Clears this buffer and fills its content with value.
public static  IoBufferwrap(ByteBuffer nioBuffer)
     Wraps the specified NIO ByteBuffer into MINA buffer.
public static  IoBufferwrap(byte[] byteArray)
     Wraps the specified byte array into MINA heap buffer.
public static  IoBufferwrap(byte[] byteArray, int offset, int length)
     Wraps the specified byte array into MINA heap buffer.

Field Detail
EMPTY_BUFFER
final public static IoBuffer EMPTY_BUFFER(Code)
An immutable empty buffer.



primitiveTypeNames
final protected static Set<String> primitiveTypeNames(Code)




Constructor Detail
IoBuffer
protected IoBuffer()(Code)
Creates a new instance. This is an empty constructor.




Method Detail
allocate
public static IoBuffer allocate(int capacity)(Code)
Returns the direct or heap buffer which is capable to store the specified amount of bytes.
Parameters:
  capacity - the capacity of the buffer
See Also:   IoBuffer.setUseDirectBuffer(boolean)



allocate
public static IoBuffer allocate(int capacity, boolean direct)(Code)
Returns the buffer which is capable of the specified size.
Parameters:
  capacity - the capacity of the buffer
Parameters:
  direct - true to get a direct buffer,false to get a heap buffer.



array
abstract public byte[] array()(Code)

See Also:   ByteBuffer.array



arrayOffset
abstract public int arrayOffset()(Code)

See Also:   ByteBuffer.arrayOffset



asCharBuffer
abstract public CharBuffer asCharBuffer()(Code)

See Also:   ByteBuffer.asCharBuffer



asDoubleBuffer
abstract public DoubleBuffer asDoubleBuffer()(Code)

See Also:   ByteBuffer.asDoubleBuffer



asFloatBuffer
abstract public FloatBuffer asFloatBuffer()(Code)

See Also:   ByteBuffer.asFloatBuffer



asInputStream
abstract public InputStream asInputStream()(Code)
Returns an InputStream that reads the data from this buffer. InputStream.read returns -1 if the buffer position reaches to the limit.



asIntBuffer
abstract public IntBuffer asIntBuffer()(Code)

See Also:   ByteBuffer.asIntBuffer



asLongBuffer
abstract public LongBuffer asLongBuffer()(Code)

See Also:   ByteBuffer.asLongBuffer



asOutputStream
abstract public OutputStream asOutputStream()(Code)
Returns an OutputStream that appends the data into this buffer. Please note that the OutputStream.write(int) will throw a BufferOverflowException instead of an IOException in case of buffer overflow. Please set autoExpand property by calling IoBuffer.setAutoExpand(boolean) to prevent the unexpected runtime exception.



asReadOnlyBuffer
abstract public IoBuffer asReadOnlyBuffer()(Code)

See Also:   ByteBuffer.asReadOnlyBuffer



asShortBuffer
abstract public ShortBuffer asShortBuffer()(Code)

See Also:   ByteBuffer.asShortBuffer



buf
abstract public ByteBuffer buf()(Code)
Returns the underlying NIO buffer instance.



capacity
abstract public int capacity()(Code)

See Also:   ByteBuffer.capacity



capacity
abstract public IoBuffer capacity(int newCapacity)(Code)
Increases the capacity of this buffer. If the new capacity is less than or equal to the current capacity, this method returns silently. If the new capacity is greater than the current capacity, the buffer is reallocated while retaining the position, limit, mark and the content of the buffer.



clear
abstract public IoBuffer clear()(Code)

See Also:   java.nio.Buffer.clear



compact
abstract public IoBuffer compact()(Code)

See Also:   ByteBuffer.compact



duplicate
abstract public IoBuffer duplicate()(Code)

See Also:   ByteBuffer.duplicate



expand
abstract public IoBuffer expand(int expectedRemaining)(Code)
Changes the capacity and limit of this buffer so this buffer get the specified expectedRemaining room from the current position. This method works even if you didn't set autoExpand to true.



expand
abstract public IoBuffer expand(int position, int expectedRemaining)(Code)
Changes the capacity and limit of this buffer so this buffer get the specified expectedRemaining room from the specified position. This method works even if you didn't set autoExpand to true.



fill
abstract public IoBuffer fill(byte value, int size)(Code)
Fills this buffer with the specified value. This method moves buffer position forward.



fill
abstract public IoBuffer fill(int size)(Code)
Fills this buffer with NUL (0x00). This method moves buffer position forward.



fillAndReset
abstract public IoBuffer fillAndReset(byte value, int size)(Code)
Fills this buffer with the specified value. This method does not change buffer position.



fillAndReset
abstract public IoBuffer fillAndReset(int size)(Code)
Fills this buffer with NUL (0x00). This method does not change buffer position.



flip
abstract public IoBuffer flip()(Code)

See Also:   java.nio.Buffer.flip



free
abstract public void free()(Code)
Declares this buffer and all its derived buffers are not used anymore so that it can be reused by some IoBufferAllocator implementations. It is not mandatory to call this method, but you might want to invoke this method for maximum performance.



get
abstract public byte get()(Code)

See Also:   ByteBuffer.get



get
abstract public byte get(int index)(Code)

See Also:   ByteBuffer.get(int)



get
abstract public IoBuffer get(byte[] dst, int offset, int length)(Code)

See Also:   ByteBuffer.get(byte[]intint)



get
abstract public IoBuffer get(byte[] dst)(Code)

See Also:   ByteBuffer.get(byte[])



getAllocator
public static IoBufferAllocator getAllocator()(Code)
Returns the allocator used by existing and new buffers



getChar
abstract public char getChar()(Code)

See Also:   ByteBuffer.getChar



getChar
abstract public char getChar(int index)(Code)

See Also:   ByteBuffer.getChar(int)



getDouble
abstract public double getDouble()(Code)

See Also:   ByteBuffer.getDouble



getDouble
abstract public double getDouble(int index)(Code)

See Also:   ByteBuffer.getDouble(int)



getEnum
abstract public E getEnum(Class<E> enumClass)(Code)
Reads a byte from the buffer and returns the correlating enum constant defined by the specified enum type. <
Parameters:
  E - > The enum type to return
Parameters:
  enumClass - The enum's class object



getEnum
abstract public E getEnum(int index, Class<E> enumClass)(Code)
Reads a byte from the buffer and returns the correlating enum constant defined by the specified enum type. <
Parameters:
  E - > The enum type to return
Parameters:
  index - the index from which the byte will be read
Parameters:
  enumClass - The enum's class object



getEnumInt
abstract public E getEnumInt(Class<E> enumClass)(Code)
Reads an int from the buffer and returns the correlating enum constant defined by the specified enum type. <
Parameters:
  E - > The enum type to return
Parameters:
  enumClass - The enum's class object



getEnumInt
abstract public E getEnumInt(int index, Class<E> enumClass)(Code)
Reads an int from the buffer and returns the correlating enum constant defined by the specified enum type. <
Parameters:
  E - > The enum type to return
Parameters:
  index - the index from which the bytes will be read
Parameters:
  enumClass - The enum's class object



getEnumSet
abstract public EnumSet<E> getEnumSet(Class<E> enumClass)(Code)
Reads a byte sized bit vector and converts it to an EnumSet .

Each bit is mapped to a value in the specified enum. The least significant bit maps to the first entry in the specified enum and each subsequent bit maps to each subsequent bit as mapped to the subsequent enum value.

<
Parameters:
  E - > the enum type
Parameters:
  enumClass - the enum class used to create the EnumSet the EnumSet representation of the bit vector



getEnumSet
abstract public EnumSet<E> getEnumSet(int index, Class<E> enumClass)(Code)
Reads a byte sized bit vector and converts it to an EnumSet .
See Also:   IoBuffer.getEnumSet(Class)<
Parameters:
  E - > the enum type
Parameters:
  index - the index from which the byte will be read
Parameters:
  enumClass - the enum class used to create the EnumSet the EnumSet representation of the bit vector



getEnumSetInt
abstract public EnumSet<E> getEnumSetInt(Class<E> enumClass)(Code)
Reads an int sized bit vector and converts it to an EnumSet .
See Also:   IoBuffer.getEnumSet(Class)<
Parameters:
  E - > the enum type
Parameters:
  enumClass - the enum class used to create the EnumSet the EnumSet representation of the bit vector



getEnumSetInt
abstract public EnumSet<E> getEnumSetInt(int index, Class<E> enumClass)(Code)
Reads an int sized bit vector and converts it to an EnumSet .
See Also:   IoBuffer.getEnumSet(Class)<
Parameters:
  E - > the enum type
Parameters:
  index - the index from which the bytes will be read
Parameters:
  enumClass - the enum class used to create the EnumSet the EnumSet representation of the bit vector



getEnumSetLong
abstract public EnumSet<E> getEnumSetLong(Class<E> enumClass)(Code)
Reads a long sized bit vector and converts it to an EnumSet .
See Also:   IoBuffer.getEnumSet(Class)<
Parameters:
  E - > the enum type
Parameters:
  enumClass - the enum class used to create the EnumSet the EnumSet representation of the bit vector



getEnumSetLong
abstract public EnumSet<E> getEnumSetLong(int index, Class<E> enumClass)(Code)
Reads a long sized bit vector and converts it to an EnumSet .
See Also:   IoBuffer.getEnumSet(Class)<
Parameters:
  E - > the enum type
Parameters:
  index - the index from which the bytes will be read
Parameters:
  enumClass - the enum class used to create the EnumSet the EnumSet representation of the bit vector



getEnumSetShort
abstract public EnumSet<E> getEnumSetShort(Class<E> enumClass)(Code)
Reads a short sized bit vector and converts it to an EnumSet .
See Also:   IoBuffer.getEnumSet(Class)<
Parameters:
  E - > the enum type
Parameters:
  enumClass - the enum class used to create the EnumSet the EnumSet representation of the bit vector



getEnumSetShort
abstract public EnumSet<E> getEnumSetShort(int index, Class<E> enumClass)(Code)
Reads a short sized bit vector and converts it to an EnumSet .
See Also:   IoBuffer.getEnumSet(Class)<
Parameters:
  E - > the enum type
Parameters:
  index - the index from which the bytes will be read
Parameters:
  enumClass - the enum class used to create the EnumSet the EnumSet representation of the bit vector



getEnumShort
abstract public E getEnumShort(Class<E> enumClass)(Code)
Reads a short from the buffer and returns the correlating enum constant defined by the specified enum type. <
Parameters:
  E - > The enum type to return
Parameters:
  enumClass - The enum's class object



getEnumShort
abstract public E getEnumShort(int index, Class<E> enumClass)(Code)
Reads a short from the buffer and returns the correlating enum constant defined by the specified enum type. <
Parameters:
  E - > The enum type to return
Parameters:
  index - the index from which the bytes will be read
Parameters:
  enumClass - The enum's class object



getFloat
abstract public float getFloat()(Code)

See Also:   ByteBuffer.getFloat



getFloat
abstract public float getFloat(int index)(Code)

See Also:   ByteBuffer.getFloat(int)



getHexDump
abstract public String getHexDump()(Code)
Returns hexdump of this buffer. The data and pointer are not changed as a result of this method call. hexidecimal representation of this buffer



getHexDump
abstract public String getHexDump(int lengthLimit)(Code)
Return hexdump of this buffer with limited length.
Parameters:
  lengthLimit - The maximum number of bytes to dump fromthe current buffer position.hexidecimal representation of this buffer



getInt
abstract public int getInt()(Code)

See Also:   ByteBuffer.getInt



getInt
abstract public int getInt(int index)(Code)

See Also:   ByteBuffer.getInt(int)



getLong
abstract public long getLong()(Code)

See Also:   ByteBuffer.getLong



getLong
abstract public long getLong(int index)(Code)

See Also:   ByteBuffer.getLong(int)



getMediumInt
abstract public int getMediumInt()(Code)
Relative get method for reading a medium int value.

Reads the next three 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 three.

The medium int value at the buffer's current position



getMediumInt
abstract public int getMediumInt(int index)(Code)
Absolute get method for reading a medium int value.

Reads the next three bytes at this buffer's current position, composing them into an int value according to the current byte order.


Parameters:
  index - The index from which the medium int will be read The medium int value at the given index
throws:
  IndexOutOfBoundsException - If index is negativeor not smaller than the buffer's limit



getObject
abstract public Object getObject() throws ClassNotFoundException(Code)
Reads a Java object from the buffer using the context ClassLoader of the current thread.



getObject
abstract public Object getObject(ClassLoader classLoader) throws ClassNotFoundException(Code)
Reads a Java object from the buffer using the specified classLoader.



getPrefixedString
abstract public String getPrefixedString(CharsetDecoder decoder) throws CharacterCodingException(Code)
Reads a string which has a 16-bit length field before the actual encoded string, using the specified decoder and returns it. This method is a shortcut for getPrefixedString(2, decoder).



getPrefixedString
abstract public String getPrefixedString(int prefixLength, CharsetDecoder decoder) throws CharacterCodingException(Code)
Reads a string which has a length field before the actual encoded string, using the specified decoder and returns it.
Parameters:
  prefixLength - the length of the length field (1, 2, or 4)



getShort
abstract public short getShort()(Code)

See Also:   ByteBuffer.getShort



getShort
abstract public short getShort(int index)(Code)

See Also:   ByteBuffer.getShort



getSlice
abstract public IoBuffer getSlice(int index, int length)(Code)
TODO document me.



getSlice
abstract public IoBuffer getSlice(int length)(Code)
TODO document me.



getString
abstract public String getString(CharsetDecoder decoder) throws CharacterCodingException(Code)
Reads a NUL-terminated string from this buffer using the specified decoder and returns it. This method reads until the limit of this buffer if no NUL is found.



getString
abstract public String getString(int fieldSize, CharsetDecoder decoder) throws CharacterCodingException(Code)
Reads a NUL-terminated string from this buffer using the specified decoder and returns it.
Parameters:
  fieldSize - the maximum number of bytes to read



getUnsigned
abstract public short getUnsigned()(Code)
Reads one unsigned byte as a short integer.



getUnsigned
abstract public short getUnsigned(int index)(Code)
Reads one byte as an unsigned short integer.



getUnsignedInt
abstract public long getUnsignedInt()(Code)
Reads four bytes unsigned integer.



getUnsignedInt
abstract public long getUnsignedInt(int index)(Code)
Reads four bytes unsigned integer.



getUnsignedMediumInt
abstract public int getUnsignedMediumInt()(Code)
Relative get method for reading an unsigned medium int value.

Reads the next three 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 three.

The unsigned medium int value at the buffer's current position



getUnsignedMediumInt
abstract public int getUnsignedMediumInt(int index)(Code)
Absolute get method for reading an unsigned medium int value.

Reads the next three bytes at this buffer's current position, composing them into an int value according to the current byte order.


Parameters:
  index - The index from which the unsigned medium int will be read The unsigned medium int value at the given index
throws:
  IndexOutOfBoundsException - If index is negativeor not smaller than the buffer's limit



getUnsignedShort
abstract public int getUnsignedShort()(Code)
Reads two bytes unsigned integer.



getUnsignedShort
abstract public int getUnsignedShort(int index)(Code)
Reads two bytes unsigned integer.



hasArray
abstract public boolean hasArray()(Code)

See Also:   ByteBuffer.hasArray



hasRemaining
abstract public boolean hasRemaining()(Code)

See Also:   java.nio.Buffer.hasRemaining



indexOf
abstract public int indexOf(byte b)(Code)
Returns the first occurence position of the specified byte from the current position to the current limit. -1 if the specified byte is not found



isAutoExpand
abstract public boolean isAutoExpand()(Code)
Returns true if and only if autoExpand is turned on.



isAutoShrink
abstract public boolean isAutoShrink()(Code)
Returns true if and only if autoShrink is turned on.



isDerived
abstract public boolean isDerived()(Code)
returns true if and only if this buffer is derived from other buffer via IoBuffer.duplicate() , IoBuffer.slice() or IoBuffer.asReadOnlyBuffer() .



isDirect
abstract public boolean isDirect()(Code)

See Also:   ByteBuffer.isDirect



isReadOnly
abstract public boolean isReadOnly()(Code)

See Also:   ByteBuffer.isReadOnly



isUseDirectBuffer
public static boolean isUseDirectBuffer()(Code)
Returns true if and only if a direct buffer is allocated by default when the type of the new buffer is not specified. The default value is false.



limit
abstract public int limit()(Code)

See Also:   java.nio.Buffer.limit



limit
abstract public IoBuffer limit(int newLimit)(Code)

See Also:   java.nio.Buffer.limit(int)



mark
abstract public IoBuffer mark()(Code)

See Also:   java.nio.Buffer.mark



markValue
abstract public int markValue()(Code)
Returns the position of the current mark. This method returns -1 if no mark is set.



minimumCapacity
abstract public int minimumCapacity()(Code)
Returns the minimum capacity of this buffer which is used to determine the new capacity of the buffer shrunk by IoBuffer.compact() and IoBuffer.shrink() operation. The default value is the initial capacity of the buffer.



minimumCapacity
abstract public IoBuffer minimumCapacity(int minimumCapacity)(Code)
Sets the minimum capacity of this buffer which is used to determine the new capacity of the buffer shrunk by IoBuffer.compact() and IoBuffer.shrink() operation. The default value is the initial capacity of the buffer.



normalizeCapacity
protected static int normalizeCapacity(int requestedCapacity)(Code)
Normalizes the specified capacity of the buffer to power of 2, which is often helpful for optimal memory usage and performance. If it is greater than or equal to Integer.MAX_VALUE , it returns Integer.MAX_VALUE . If it is zero, it returns zero.



order
abstract public ByteOrder order()(Code)

See Also:   ByteBuffer.order



order
abstract public IoBuffer order(ByteOrder bo)(Code)

See Also:   ByteBuffer.order(ByteOrder)



position
abstract public int position()(Code)

See Also:   java.nio.Buffer.position



position
abstract public IoBuffer position(int newPosition)(Code)

See Also:   java.nio.Buffer.position(int)



prefixedDataAvailable
abstract public boolean prefixedDataAvailable(int prefixLength)(Code)
Returns true if this buffer contains a data which has a data length as a prefix and the buffer has remaining data as enough as specified in the data length field. This method is identical with prefixedDataAvailable( prefixLength, Integer.MAX_VALUE ). Please not that using this method can allow DoS (Denial of Service) attack in case the remote peer sends too big data length value. It is recommended to use IoBuffer.prefixedDataAvailable(int,int) instead.
Parameters:
  prefixLength - the length of the prefix field (1, 2, or 4)
throws:
  IllegalArgumentException - if prefixLength is wrong
throws:
  BufferDataException - if data length is negative



prefixedDataAvailable
abstract public boolean prefixedDataAvailable(int prefixLength, int maxDataLength)(Code)
Returns true if this buffer contains a data which has a data length as a prefix and the buffer has remaining data as enough as specified in the data length field.
Parameters:
  prefixLength - the length of the prefix field (1, 2, or 4)
Parameters:
  maxDataLength - the allowed maximum of the read data length
throws:
  IllegalArgumentException - if prefixLength is wrong
throws:
  BufferDataException - if data length is negative or greater then maxDataLength



put
abstract public IoBuffer put(byte b)(Code)

See Also:   ByteBuffer.put(byte)



put
abstract public IoBuffer put(int index, byte b)(Code)

See Also:   ByteBuffer.put(intbyte)



put
abstract public IoBuffer put(ByteBuffer src)(Code)
Writes the content of the specified src into this buffer.



put
abstract public IoBuffer put(IoBuffer src)(Code)
Writes the content of the specified src into this buffer.



put
abstract public IoBuffer put(byte[] src, int offset, int length)(Code)

See Also:   ByteBuffer.put(byte[]intint)



put
abstract public IoBuffer put(byte[] src)(Code)

See Also:   ByteBuffer.put(byte[])



putChar
abstract public IoBuffer putChar(char value)(Code)

See Also:   ByteBuffer.putChar(char)



putChar
abstract public IoBuffer putChar(int index, char value)(Code)

See Also:   ByteBuffer.putChar(intchar)



putDouble
abstract public IoBuffer putDouble(double value)(Code)

See Also:   ByteBuffer.putDouble(double)



putDouble
abstract public IoBuffer putDouble(int index, double value)(Code)

See Also:   ByteBuffer.putDouble(intdouble)



putEnum
abstract public IoBuffer putEnum(Enum e)(Code)
Writes an enum's ordinal value to the buffer as a byte.
Parameters:
  e - The enum to write to the buffer



putEnum
abstract public IoBuffer putEnum(int index, Enum e)(Code)
Writes an enum's ordinal value to the buffer as a byte.
Parameters:
  index - The index at which the byte will be written
Parameters:
  e - The enum to write to the buffer



putEnumInt
abstract public IoBuffer putEnumInt(Enum e)(Code)
Writes an enum's ordinal value to the buffer as an integer.
Parameters:
  e - The enum to write to the buffer



putEnumInt
abstract public IoBuffer putEnumInt(int index, Enum e)(Code)
Writes an enum's ordinal value to the buffer as an integer.
Parameters:
  index - The index at which the bytes will be written
Parameters:
  e - The enum to write to the buffer



putEnumSet
abstract public IoBuffer putEnumSet(Set<E> set)(Code)
Writes the specified Set to the buffer as a byte sized bit vector. <
Parameters:
  E - > the enum type of the Set
Parameters:
  set - the enum set to write to the buffer



putEnumSet
abstract public IoBuffer putEnumSet(int index, Set<E> set)(Code)
Writes the specified Set to the buffer as a byte sized bit vector. <
Parameters:
  E - > the enum type of the Set
Parameters:
  index - the index at which the byte will be written
Parameters:
  set - the enum set to write to the buffer



putEnumSetInt
abstract public IoBuffer putEnumSetInt(Set<E> set)(Code)
Writes the specified Set to the buffer as an int sized bit vector. <
Parameters:
  E - > the enum type of the Set
Parameters:
  set - the enum set to write to the buffer



putEnumSetInt
abstract public IoBuffer putEnumSetInt(int index, Set<E> set)(Code)
Writes the specified Set to the buffer as an int sized bit vector. <
Parameters:
  E - > the enum type of the Set
Parameters:
  index - the index at which the bytes will be written
Parameters:
  set - the enum set to write to the buffer



putEnumSetLong
abstract public IoBuffer putEnumSetLong(Set<E> set)(Code)
Writes the specified Set to the buffer as a long sized bit vector. <
Parameters:
  E - > the enum type of the Set
Parameters:
  set - the enum set to write to the buffer



putEnumSetLong
abstract public IoBuffer putEnumSetLong(int index, Set<E> set)(Code)
Writes the specified Set to the buffer as a long sized bit vector. <
Parameters:
  E - > the enum type of the Set
Parameters:
  index - the index at which the bytes will be written
Parameters:
  set - the enum set to write to the buffer



putEnumSetShort
abstract public IoBuffer putEnumSetShort(Set<E> set)(Code)
Writes the specified Set to the buffer as a short sized bit vector. <
Parameters:
  E - > the enum type of the Set
Parameters:
  set - the enum set to write to the buffer



putEnumSetShort
abstract public IoBuffer putEnumSetShort(int index, Set<E> set)(Code)
Writes the specified Set to the buffer as a short sized bit vector. <
Parameters:
  E - > the enum type of the Set
Parameters:
  index - the index at which the bytes will be written
Parameters:
  set - the enum set to write to the buffer



putEnumShort
abstract public IoBuffer putEnumShort(Enum e)(Code)
Writes an enum's ordinal value to the buffer as a short.
Parameters:
  e - The enum to write to the buffer



putEnumShort
abstract public IoBuffer putEnumShort(int index, Enum e)(Code)
Writes an enum's ordinal value to the buffer as a short.
Parameters:
  index - The index at which the bytes will be written
Parameters:
  e - The enum to write to the buffer



putFloat
abstract public IoBuffer putFloat(float value)(Code)

See Also:   ByteBuffer.putFloat(float)



putFloat
abstract public IoBuffer putFloat(int index, float value)(Code)

See Also:   ByteBuffer.putFloat(intfloat)



putInt
abstract public IoBuffer putInt(int value)(Code)

See Also:   ByteBuffer.putInt(int)



putInt
abstract public IoBuffer putInt(int index, int value)(Code)

See Also:   ByteBuffer.putInt(intint)



putLong
abstract public IoBuffer putLong(long value)(Code)

See Also:   ByteBuffer.putLong(intlong)



putLong
abstract public IoBuffer putLong(int index, long value)(Code)

See Also:   ByteBuffer.putLong(intlong)



putMediumInt
abstract public IoBuffer putMediumInt(int value)(Code)
Relative put method for writing a medium int value.

Writes three bytes containing the given int value, in the current byte order, into this buffer at the current position, and then increments the position by three.


Parameters:
  value - The medium int value to be written This buffer
throws:
  BufferOverflowException - If there are fewer than three bytesremaining in this buffer
throws:
  ReadOnlyBufferException - If this buffer is read-only



putMediumInt
abstract public IoBuffer putMediumInt(int index, int value)(Code)
Absolute put method for writing a medium int value.

Writes three bytes containing the given int value, in the current byte order, into this buffer at the given index.


Parameters:
  index - The index at which the bytes will be written
Parameters:
  value - The medium int value to be written This buffer
throws:
  IndexOutOfBoundsException - If index is negativeor not smaller than the buffer's limit,minus three
throws:
  ReadOnlyBufferException - If this buffer is read-only



putObject
abstract public IoBuffer putObject(Object o)(Code)
Writes the specified Java object to the buffer.



putPrefixedString
abstract public IoBuffer putPrefixedString(CharSequence in, CharsetEncoder encoder) throws CharacterCodingException(Code)
Writes the content of in into this buffer as a string which has a 16-bit length field before the actual encoded string, using the specified encoder. This method is a shortcut for putPrefixedString(in, 2, 0, encoder).
throws:
  BufferOverflowException - if the specified string doesn't fit



putPrefixedString
abstract public IoBuffer putPrefixedString(CharSequence in, int prefixLength, CharsetEncoder encoder) throws CharacterCodingException(Code)
Writes the content of in into this buffer as a string which has a 16-bit length field before the actual encoded string, using the specified encoder. This method is a shortcut for putPrefixedString(in, prefixLength, 0, encoder).
Parameters:
  prefixLength - the length of the length field (1, 2, or 4)
throws:
  BufferOverflowException - if the specified string doesn't fit



putPrefixedString
abstract public IoBuffer putPrefixedString(CharSequence in, int prefixLength, int padding, CharsetEncoder encoder) throws CharacterCodingException(Code)
Writes the content of in into this buffer as a string which has a 16-bit length field before the actual encoded string, using the specified encoder. This method is a shortcut for putPrefixedString(in, prefixLength, padding, ( byte ) 0, encoder).
Parameters:
  prefixLength - the length of the length field (1, 2, or 4)
Parameters:
  padding - the number of padded NULs (1 (or 0), 2, or 4)
throws:
  BufferOverflowException - if the specified string doesn't fit



putPrefixedString
abstract public IoBuffer putPrefixedString(CharSequence val, int prefixLength, int padding, byte padValue, CharsetEncoder encoder) throws CharacterCodingException(Code)
Writes the content of in into this buffer as a string which has a 16-bit length field before the actual encoded string, using the specified encoder.
Parameters:
  prefixLength - the length of the length field (1, 2, or 4)
Parameters:
  padding - the number of padded bytes (1 (or 0), 2, or 4)
Parameters:
  padValue - the value of padded bytes
throws:
  BufferOverflowException - if the specified string doesn't fit



putShort
abstract public IoBuffer putShort(short value)(Code)

See Also:   ByteBuffer.putShort(short)



putShort
abstract public IoBuffer putShort(int index, short value)(Code)

See Also:   ByteBuffer.putShort(intshort)



putString
abstract public IoBuffer putString(CharSequence val, CharsetEncoder encoder) throws CharacterCodingException(Code)
Writes the content of in into this buffer using the specified encoder. This method doesn't terminate string with NUL. You have to do it by yourself.
throws:
  BufferOverflowException - if the specified string doesn't fit



putString
abstract public IoBuffer putString(CharSequence val, int fieldSize, CharsetEncoder encoder) throws CharacterCodingException(Code)
Writes the content of in into this buffer as a NUL-terminated string using the specified encoder.

If the charset name of the encoder is UTF-16, you cannot specify odd fieldSize, and this method will append two NULs as a terminator.

Please note that this method doesn't terminate with NUL if the input string is longer than fieldSize.
Parameters:
  fieldSize - the maximum number of bytes to write




remaining
abstract public int remaining()(Code)

See Also:   java.nio.Buffer.remaining



reset
abstract public IoBuffer reset()(Code)

See Also:   java.nio.Buffer.reset



rewind
abstract public IoBuffer rewind()(Code)

See Also:   java.nio.Buffer.rewind



setAllocator
public static void setAllocator(IoBufferAllocator newAllocator)(Code)
Sets the allocator used by existing and new buffers



setAutoExpand
abstract public IoBuffer setAutoExpand(boolean autoExpand)(Code)
Turns on or off autoExpand.



setAutoShrink
abstract public IoBuffer setAutoShrink(boolean autoShrink)(Code)
Turns on or off autoShrink.



setUseDirectBuffer
public static void setUseDirectBuffer(boolean useDirectBuffer)(Code)
Sets if a direct buffer should be allocated by default when the type of the new buffer is not specified. The default value is false.



shrink
abstract public IoBuffer shrink()(Code)
Changes the capacity of this buffer so this buffer occupies as less memory as possible while retaining the position, limit and the buffer content between the position and limit. The capacity of the buffer never becomes less than IoBuffer.minimumCapacity() . The mark is discarded once the capacity changes.



skip
abstract public IoBuffer skip(int size)(Code)
Forwards the position of this buffer as the specified size bytes.



slice
abstract public IoBuffer slice()(Code)

See Also:   ByteBuffer.slice



sweep
abstract public IoBuffer sweep()(Code)
Clears this buffer and fills its content with NUL. The position is set to zero, the limit is set to the capacity, and the mark is discarded.



sweep
abstract public IoBuffer sweep(byte value)(Code)
Clears this buffer and fills its content with value. The position is set to zero, the limit is set to the capacity, and the mark is discarded.



wrap
public static IoBuffer wrap(ByteBuffer nioBuffer)(Code)
Wraps the specified NIO ByteBuffer into MINA buffer.



wrap
public static IoBuffer wrap(byte[] byteArray)(Code)
Wraps the specified byte array into MINA heap buffer.



wrap
public static IoBuffer wrap(byte[] byteArray, int offset, int length)(Code)
Wraps the specified byte array into MINA heap buffer.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.