|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmultiverse.server.network.MVByteBuffer
public class MVByteBuffer
| Field Summary | |
|---|---|
private static Map<Class,Byte> |
classToValueTypeMap
|
private ByteBuffer |
mBB
|
private static byte |
valueTypeBoolean
|
private static byte |
valueTypeBooleanFalse
|
private static byte |
valueTypeBooleanTrue
|
private static byte |
valueTypeByte
|
private static byte |
valueTypeByteArray
|
private static byte |
valueTypeColor
|
private static byte |
valueTypeDouble
|
private static byte |
valueTypeFloat
|
private static byte |
valueTypeHashMap
|
private static byte |
valueTypeHashSet
|
private static byte |
valueTypeInteger
|
private static byte |
valueTypeLinkedList
|
private static byte |
valueTypeLong
|
private static byte |
valueTypeMVVector
|
private static byte |
valueTypeNull
|
private static byte |
valueTypePoint
|
private static byte |
valueTypeQuaternion
|
private static byte |
valueTypeShort
|
private static byte |
valueTypeString
|
private static byte |
valueTypeTreeMap
|
| Constructor Summary | |
|---|---|
MVByteBuffer(byte[] data)
creates a new byte buffer that is the length of the byte array passed in and places the bytes into the new buffer. |
|
MVByteBuffer(ByteBuffer data)
|
|
MVByteBuffer(int size)
|
|
| Method Summary | |
|---|---|
byte[] |
array()
returns the backing array - not useful to send across network the backing array encoding format may not be the same as what you entered and therefore you should use getBytes instead. |
int |
capacity()
|
MVByteBuffer |
clear()
|
Object |
clone()
returns a copy of the byte buffer |
MVByteBuffer |
cloneAtOffset(int offset,
int length)
Returns the MVByteBuffer gotten by skipping the first offset bytes in the original buffer, and copying out by length |
int |
compareTo(MVByteBuffer buffer)
|
byte[] |
copyBytes()
basically helper function to getBytes that rewinds first and returns a copy of the bytes. |
byte[] |
copyBytesFromZeroToLimit()
this version of copyBytes gets the same bytes as the version above, with the same goofy business of ignoring the starting position, but this version also doesn't change position. |
MVByteBuffer |
flip()
|
boolean |
getBoolean()
|
byte |
getByte()
|
byte[] |
getByteArray()
|
MVByteBuffer |
getByteBuffer()
|
MVByteBuffer |
getBytes(byte[] dst,
int offset,
int length)
|
Color |
getColor()
|
double |
getDouble()
|
Serializable |
getEncodedObject()
|
float |
getFloat()
|
int |
getInt()
|
long |
getLong()
|
MVVector |
getMVVector()
|
ByteBuffer |
getNioBuf()
|
Point |
getPoint()
|
Map<String,Serializable> |
getPropertyMap()
|
Quaternion |
getQuaternion()
|
short |
getShort()
|
String |
getString()
|
Map<String,Serializable> |
getTreeMap()
|
boolean |
hasRemaining()
|
private static void |
initializeClassToValueTypeMap()
|
int |
limit()
|
MVByteBuffer |
limit(int newLimit)
|
private void |
logPropertyMap(String prefix,
Map<String,Serializable> propertyMap,
Set<String> filteredProps)
|
static void |
main(String[] args)
|
int |
position()
|
MVByteBuffer |
position(int newPos)
|
MVByteBuffer |
putBoolean(boolean b)
|
MVByteBuffer |
putByte(byte b)
|
MVByteBuffer |
putByteArray(byte[] byteArray)
|
MVByteBuffer |
putByteBuffer(MVByteBuffer other)
|
MVByteBuffer |
putBytes(byte[] src,
int offset,
int length)
|
MVByteBuffer |
putColor(Color c)
|
MVByteBuffer |
putDouble(double d)
|
void |
putEncodedObject(Serializable val)
|
void |
putFilteredPropertyMap(Map<String,Serializable> propertyMap,
Set<String> filteredProps)
|
MVByteBuffer |
putFloat(float f)
|
MVByteBuffer |
putInt(int i)
|
MVByteBuffer |
putLong(long l)
|
MVByteBuffer |
putMsgTypeString(MessageType msgType)
|
MVByteBuffer |
putMVVector(MVVector v)
|
MVByteBuffer |
putPoint(Point p)
|
void |
putPropertyMap(Map<String,Serializable> propertyMap)
|
MVByteBuffer |
putQuaternion(Quaternion q)
|
MVByteBuffer |
putShort(short s)
|
MVByteBuffer |
putString(String s)
|
private void |
reallocate()
|
private void |
reallocate(int minSize)
|
int |
remaining()
|
MVByteBuffer |
rewind()
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final byte valueTypeNull
private static final byte valueTypeString
private static final byte valueTypeLong
private static final byte valueTypeInteger
private static final byte valueTypeBoolean
private static final byte valueTypeBooleanFalse
private static final byte valueTypeBooleanTrue
private static final byte valueTypeFloat
private static final byte valueTypeDouble
private static final byte valueTypePoint
private static final byte valueTypeMVVector
private static final byte valueTypeQuaternion
private static final byte valueTypeColor
private static final byte valueTypeByte
private static final byte valueTypeShort
private static final byte valueTypeLinkedList
private static final byte valueTypeHashSet
private static final byte valueTypeHashMap
private static final byte valueTypeByteArray
private static final byte valueTypeTreeMap
private static Map<Class,Byte> classToValueTypeMap
private ByteBuffer mBB
| Constructor Detail |
|---|
public MVByteBuffer(int size)
public MVByteBuffer(byte[] data)
public MVByteBuffer(ByteBuffer data)
| Method Detail |
|---|
public Object clone()
clone in class Object
public MVByteBuffer cloneAtOffset(int offset,
int length)
public byte[] array()
public int capacity()
public MVByteBuffer clear()
public MVByteBuffer flip()
public boolean hasRemaining()
public int limit()
public MVByteBuffer limit(int newLimit)
public int position()
public MVByteBuffer position(int newPos)
public int remaining()
public MVByteBuffer rewind()
public byte getByte()
public MVByteBuffer getBytes(byte[] dst,
int offset,
int length)
public byte[] copyBytes()
public byte[] copyBytesFromZeroToLimit()
public boolean getBoolean()
public double getDouble()
public float getFloat()
public short getShort()
public int getInt()
public long getLong()
public String getString()
public Point getPoint()
public Quaternion getQuaternion()
public MVVector getMVVector()
public Color getColor()
public MVByteBuffer getByteBuffer()
public byte[] getByteArray()
public MVByteBuffer putByte(byte b)
public MVByteBuffer putBytes(byte[] src,
int offset,
int length)
public MVByteBuffer putBoolean(boolean b)
public MVByteBuffer putDouble(double d)
public MVByteBuffer putFloat(float f)
public MVByteBuffer putShort(short s)
public MVByteBuffer putInt(int i)
public MVByteBuffer putLong(long l)
public MVByteBuffer putString(String s)
public MVByteBuffer putMsgTypeString(MessageType msgType)
public MVByteBuffer putPoint(Point p)
public MVByteBuffer putQuaternion(Quaternion q)
public MVByteBuffer putMVVector(MVVector v)
public MVByteBuffer putColor(Color c)
public MVByteBuffer putByteBuffer(MVByteBuffer other)
public MVByteBuffer putByteArray(byte[] byteArray)
public ByteBuffer getNioBuf()
private void reallocate()
private void reallocate(int minSize)
private static void initializeClassToValueTypeMap()
public void putEncodedObject(Serializable val)
public Serializable getEncodedObject()
public void putPropertyMap(Map<String,Serializable> propertyMap)
public void putFilteredPropertyMap(Map<String,Serializable> propertyMap,
Set<String> filteredProps)
private void logPropertyMap(String prefix,
Map<String,Serializable> propertyMap,
Set<String> filteredProps)
public Map<String,Serializable> getPropertyMap()
public Map<String,Serializable> getTreeMap()
public int compareTo(MVByteBuffer buffer)
compareTo in interface Comparable<MVByteBuffer>public static void main(String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||