Atavism Version 2018.1AGIS API

atavism.server.network
Class AOByteBuffer

java.lang.Object
  extended by atavism.server.network.AOByteBuffer
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable<AOByteBuffer>

public class AOByteBuffer
extends java.lang.Object
implements java.lang.Cloneable, java.lang.Comparable<AOByteBuffer>


Constructor Summary
AOByteBuffer(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.
AOByteBuffer(java.nio.ByteBuffer data)
           
AOByteBuffer(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()
           
 AOByteBuffer clear()
           
 java.lang.Object clone()
          returns a copy of the byte buffer
 AOByteBuffer cloneAtOffset(int offset, int length)
          Returns the AOByteBuffer gotten by skipping the first offset bytes in the original buffer, and copying out by length
 int compareTo(AOByteBuffer 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.
 AOByteBuffer flip()
           
 AOVector getAOVector()
           
 boolean getBoolean()
           
 byte getByte()
           
 byte[] getByteArray()
           
 AOByteBuffer getByteBuffer()
           
 AOByteBuffer getBytes(byte[] dst, int offset, int length)
           
 java.util.Collection<java.io.Serializable> getCollection()
           
 Color getColor()
           
 double getDouble()
           
 java.io.Serializable getEncodedObject()
           
 float getFloat()
           
 int getInt()
           
 long getLong()
           
 java.nio.ByteBuffer getNioBuf()
           
 OID getOID()
           
 Point getPoint()
           
 java.util.Map<java.lang.String,java.io.Serializable> getPropertyMap()
           
 Quaternion getQuaternion()
           
 short getShort()
           
 java.lang.String getString()
           
 java.util.Map<java.lang.String,java.io.Serializable> getTreeMap()
           
 boolean hasRemaining()
           
 int limit()
           
 AOByteBuffer limit(int newLimit)
           
static void main(java.lang.String[] args)
           
 int position()
           
 AOByteBuffer position(int newPos)
           
 AOByteBuffer putAOVector(AOVector v)
           
 AOByteBuffer putBoolean(boolean b)
           
 AOByteBuffer putByte(byte b)
           
 AOByteBuffer putByteArray(byte[] byteArray)
           
 AOByteBuffer putByteBuffer(AOByteBuffer other)
           
 AOByteBuffer putBytes(byte[] src, int offset, int length)
           
 void putCollection(java.util.Collection<java.io.Serializable> collection)
          Put a collection of serializable objects into the buffer.
 AOByteBuffer putColor(Color c)
           
 AOByteBuffer putDouble(double d)
           
 void putEncodedObject(java.io.Serializable val)
           
 void putFilteredPropertyCollection(java.util.Collection<java.lang.String> properties, java.util.Set<java.lang.String> filteredProps)
          This variant of putCollection excludes sending the entries that are contained in the filteredProps.
 void putFilteredPropertyMap(java.util.Map<java.lang.String,java.io.Serializable> propertyMap, java.util.Set<java.lang.String> filteredProps)
          This variant of putPropertyMap excludes sending the keys and associated values that are in the filteredProps.
 AOByteBuffer putFloat(float f)
           
static AOByteBuffer putInt(AOByteBuffer buffer, int i)
           
 AOByteBuffer putInt(int i)
           
 AOByteBuffer putLong(long l)
           
 AOByteBuffer putLong(java.lang.Long l)
           
 AOByteBuffer putMsgTypeString(MessageType msgType)
           
 AOByteBuffer putOID(OID oid)
           
 AOByteBuffer putPoint(Point p)
           
 void putPropertyMap(java.util.Map<java.lang.String,java.io.Serializable> propertyMap)
          Put a map of string to serializable objects into the buffer.
 AOByteBuffer putQuaternion(Quaternion q)
           
 AOByteBuffer putShort(short s)
           
static AOByteBuffer putString(AOByteBuffer buffer, java.lang.String str)
           
 AOByteBuffer putString(java.lang.String s)
           
 int remaining()
           
 AOByteBuffer rewind()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AOByteBuffer

public AOByteBuffer(int size)

AOByteBuffer

public AOByteBuffer(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. flips the buffer for reading


AOByteBuffer

public AOByteBuffer(java.nio.ByteBuffer data)
Method Detail

clone

public java.lang.Object clone()
returns a copy of the byte buffer

Overrides:
clone in class java.lang.Object

cloneAtOffset

public AOByteBuffer cloneAtOffset(int offset,
                                  int length)
Returns the AOByteBuffer gotten by skipping the first offset bytes in the original buffer, and copying out by length


array

public 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.


capacity

public int capacity()

clear

public AOByteBuffer clear()

flip

public AOByteBuffer flip()

hasRemaining

public boolean hasRemaining()

limit

public int limit()

limit

public AOByteBuffer limit(int newLimit)

position

public int position()

position

public AOByteBuffer position(int newPos)

remaining

public int remaining()

rewind

public AOByteBuffer rewind()

getByte

public byte getByte()

getBytes

public AOByteBuffer getBytes(byte[] dst,
                             int offset,
                             int length)

copyBytes

public byte[] copyBytes()
basically helper function to getBytes that rewinds first and returns a copy of the bytes. uses limit (set by flip() ) to figure out how much to copy and leaves position at the end.


copyBytesFromZeroToLimit

public 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.


getBoolean

public boolean getBoolean()

getDouble

public double getDouble()

getFloat

public float getFloat()

getShort

public short getShort()

getInt

public int getInt()

getLong

public long getLong()

getString

public java.lang.String getString()

getOID

public OID getOID()

getPoint

public Point getPoint()

getQuaternion

public Quaternion getQuaternion()

getAOVector

public AOVector getAOVector()

getColor

public Color getColor()

getByteBuffer

public AOByteBuffer getByteBuffer()

getByteArray

public byte[] getByteArray()

putByte

public AOByteBuffer putByte(byte b)

putBytes

public AOByteBuffer putBytes(byte[] src,
                             int offset,
                             int length)

putBoolean

public AOByteBuffer putBoolean(boolean b)

putDouble

public AOByteBuffer putDouble(double d)

putFloat

public AOByteBuffer putFloat(float f)

putShort

public AOByteBuffer putShort(short s)

putInt

public AOByteBuffer putInt(int i)

putLong

public AOByteBuffer putLong(long l)

putLong

public AOByteBuffer putLong(java.lang.Long l)

putString

public AOByteBuffer putString(java.lang.String s)

putMsgTypeString

public AOByteBuffer putMsgTypeString(MessageType msgType)

putOID

public AOByteBuffer putOID(OID oid)

putPoint

public AOByteBuffer putPoint(Point p)

putQuaternion

public AOByteBuffer putQuaternion(Quaternion q)

putAOVector

public AOByteBuffer putAOVector(AOVector v)

putColor

public AOByteBuffer putColor(Color c)

putByteBuffer

public AOByteBuffer putByteBuffer(AOByteBuffer other)

putByteArray

public AOByteBuffer putByteArray(byte[] byteArray)

getNioBuf

public java.nio.ByteBuffer getNioBuf()

putEncodedObject

public void putEncodedObject(java.io.Serializable val)

getEncodedObject

public java.io.Serializable getEncodedObject()

putCollection

public void putCollection(java.util.Collection<java.io.Serializable> collection)
Put a collection of serializable objects into the buffer. This writes the number of entries (an integer), followed by a putEncodedObject of each entry in the collection.

Parameters:
collection -

putPropertyMap

public void putPropertyMap(java.util.Map<java.lang.String,java.io.Serializable> propertyMap)
Put a map of string to serializable objects into the buffer. This writes the number of entries (an integer), followed by a putString and putEncodedObject for each entry in the propertyMap.

Parameters:
propertyMap -

putFilteredPropertyMap

public void putFilteredPropertyMap(java.util.Map<java.lang.String,java.io.Serializable> propertyMap,
                                   java.util.Set<java.lang.String> filteredProps)
This variant of putPropertyMap excludes sending the keys and associated values that are in the filteredProps.

Parameters:
propertyMap -
filteredProps -

putFilteredPropertyCollection

public void putFilteredPropertyCollection(java.util.Collection<java.lang.String> properties,
                                          java.util.Set<java.lang.String> filteredProps)
This variant of putCollection excludes sending the entries that are contained in the filteredProps.

Parameters:
properties -
filteredProps -

getCollection

public java.util.Collection<java.io.Serializable> getCollection()

getPropertyMap

public java.util.Map<java.lang.String,java.io.Serializable> getPropertyMap()

getTreeMap

public java.util.Map<java.lang.String,java.io.Serializable> getTreeMap()

compareTo

public int compareTo(AOByteBuffer buffer)
Specified by:
compareTo in interface java.lang.Comparable<AOByteBuffer>

main

public static void main(java.lang.String[] args)

putInt

public static AOByteBuffer putInt(AOByteBuffer buffer,
                                  int i)

putString

public static AOByteBuffer putString(AOByteBuffer buffer,
                                     java.lang.String str)


Copyright © 2018 Dragonsan Studios Sp. z o.o.