feud.clientserver
Class DataContainerFactory
java.lang.Object
feud.clientserver.DataContainerFactory
- public class DataContainerFactory
- extends java.lang.Object
A helper class to wrap an array of bytes into one of DataContainers and vice versa. See DataContainer itself
for more info on how DataContainers are working and being transfered.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DataContainerFactory
public DataContainerFactory()
extractContainers
public static DataContainer[] extractContainers(byte[] bytes,
boolean zip)
- Creates an array for DataContainers from a byte array. Usually, the byte array is waht has been transfered
from client to server or vice versa.
- Parameters:
bytes
- the byte arrayzip
- if true, the data in the array is assumed to be zipped
- Returns:
- DataContainer[] the resulting DataContainers
toByteArray
public static byte[] toByteArray(DataContainer[] dcs,
boolean zip)
- Create a byte array out of an array of DataContainers.
- Parameters:
dcs
- the containerszip
- boolean should the byte array be zipped?
- Returns:
- byte[] the resulting byte array.