com.moesol.nio
Class UnsignedShortBuffer

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

public class UnsignedShortBuffer
extends Object
implements BufferMarker, Comparable

Help getting bytes back as unsigned short (C size 4 bytes). Same as CharBuffer, but System.out.println does the right thing.


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

Constructor Detail

UnsignedShortBuffer

public UnsignedShortBuffer(ByteBuffer b)
Method Detail

allocate

public static UnsignedShortBuffer allocate(int length)
Parameters:
length -
Returns:
new byte buffre

get

public int get()

get

public int get(int offset)

put

public void put(int v)

put

public void put(int offset,
                int v)

get

public void get(int[] result)
Parameters:
result -

put

public void put(int[] values)
Parameters:
values -

hasRemaining

public boolean hasRemaining()
Specified by:
hasRemaining in interface BufferMarker
Returns:
true if remaining

remaining

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

limit

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

capacity

public int capacity()
Specified by:
capacity in interface BufferMarker
Returns:
capacity

getByteBuffer

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

order

public UnsignedShortBuffer order(ByteOrder o)

flip

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

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

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.