com.moesol.nio
Class UnsignedByteBuffer

java.lang.Object
  extended by com.moesol.nio.UnsignedByteBuffer
All Implemented Interfaces:
BufferMarker, Comparable

public class UnsignedByteBuffer
extends Object
implements BufferMarker, Comparable

Help getting bytes back as unsigned.


Constructor Summary
UnsignedByteBuffer(ByteBuffer b)
           
 
Method Summary
static UnsignedByteBuffer allocate(int capacity)
           
 int capacity()
           
 BufferMarker clear()
           
 int compareTo(Object o)
           
 boolean equals(Object arg0)
           
 BufferMarker flip()
           
 short get()
           
 short get(int offset)
           
 void get(short[] result)
           
 ByteBuffer getByteBuffer()
           
 int hashCode()
           
 boolean hasRemaining()
           
 boolean isReadOnly()
           
 int limit()
           
 BufferMarker limit(int newLimit)
           
 BufferMarker mark()
           
 void order(ByteOrder bo)
           
 int position()
           
 BufferMarker position(int newPosition)
           
 void put(int offset, short v)
           
 void put(short v)
           
 void put(short[] values)
           
 int remaining()
           
 BufferMarker reset()
           
 BufferMarker rewind()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnsignedByteBuffer

public UnsignedByteBuffer(ByteBuffer b)
Method Detail

allocate

public static UnsignedByteBuffer allocate(int capacity)

get

public short get()

get

public short get(int offset)

get

public void get(short[] result)

put

public void put(short v)

put

public void put(int offset,
                short v)

put

public void put(short[] values)

remaining

public int remaining()
Specified by:
remaining in interface BufferMarker
Returns:
shorts remaining

limit

public int limit()
Specified by:
limit in interface BufferMarker
Returns:
number of shorts in this buffer

capacity

public int capacity()
Specified by:
capacity in interface BufferMarker
Returns:
number of shorts this buffer could store

order

public void order(ByteOrder bo)
Parameters:
bo -

flip

public BufferMarker flip()
Specified by:
flip in interface BufferMarker

getByteBuffer

public ByteBuffer getByteBuffer()
Specified by:
getByteBuffer in interface BufferMarker
Returns:
underlying byte buffer

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable

position

public int position()
Specified by:
position in interface BufferMarker

position

public BufferMarker position(int newPosition)
Specified by:
position in interface BufferMarker

limit

public BufferMarker limit(int newLimit)
Specified by:
limit in interface BufferMarker

mark

public BufferMarker mark()
Specified by:
mark in interface BufferMarker

reset

public BufferMarker reset()
Specified by:
reset in interface BufferMarker

clear

public BufferMarker clear()
Specified by:
clear in interface BufferMarker

rewind

public BufferMarker rewind()
Specified by:
rewind in interface BufferMarker

hasRemaining

public boolean hasRemaining()
Specified by:
hasRemaining in interface BufferMarker

isReadOnly

public boolean isReadOnly()
Specified by:
isReadOnly in interface BufferMarker

equals

public boolean equals(Object arg0)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2004 Moebius Solutions, Inc. All Rights Reserved.