net.yura.mobile.io
Class BinUtil

java.lang.Object
  extended by net.yura.mobile.io.BinUtil
Direct Known Subclasses:
ServiceLink.ServiceAccess

public class BinUtil
extends Object

Author:
Lenin

Field Summary
static int TYPE_ARRAY
           
static int TYPE_BOOLEAN
           
static int TYPE_BYTE
           
static int TYPE_BYTE_ARRAY
           
static int TYPE_CHARACTER
           
static int TYPE_DOUBLE
           
static int TYPE_FLOAT
           
static int TYPE_HASHTABLE
           
static int TYPE_INTEGER
           
static int TYPE_LONG
           
static int TYPE_NULL
           
static int TYPE_SHORT
           
static int TYPE_STRING
           
static int TYPE_VECTOR
           
 
Constructor Summary
BinUtil()
           
 
Method Summary
protected static void checkType(int got, int want)
           
 Object load(InputStream in)
           
protected  Object[] readArray(DataInputStream in2)
           
protected  byte[] readBytes(DataInputStream in2)
           
protected  Hashtable readHashtable(DataInputStream in2)
           
protected  Object readObject(DataInputStream in2)
           
protected  Object readObject(DataInputStream in2, int type, int size)
           
protected  Vector readVector(DataInputStream in2)
           
 void save(OutputStream out, Object obj)
           
protected  void skipUnknownObjects(DataInputStream in, int num)
           
protected  void writeArray(DataOutputStream out, Object[] object)
           
protected  void writeBytes(DataOutputStream out, byte[] bytes)
           
protected  void writeHashtable(DataOutputStream out, Hashtable hashtable)
           
protected  void writeObject(DataOutputStream out, Object obj)
           
protected  void writeVector(DataOutputStream out, Vector vector)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_ARRAY

public static final int TYPE_ARRAY
See Also:
Constant Field Values

TYPE_BOOLEAN

public static final int TYPE_BOOLEAN
See Also:
Constant Field Values

TYPE_BYTE

public static final int TYPE_BYTE
See Also:
Constant Field Values

TYPE_BYTE_ARRAY

public static final int TYPE_BYTE_ARRAY
See Also:
Constant Field Values

TYPE_CHARACTER

public static final int TYPE_CHARACTER
See Also:
Constant Field Values

TYPE_DOUBLE

public static final int TYPE_DOUBLE
See Also:
Constant Field Values

TYPE_FLOAT

public static final int TYPE_FLOAT
See Also:
Constant Field Values

TYPE_HASHTABLE

public static final int TYPE_HASHTABLE
See Also:
Constant Field Values

TYPE_INTEGER

public static final int TYPE_INTEGER
See Also:
Constant Field Values

TYPE_LONG

public static final int TYPE_LONG
See Also:
Constant Field Values

TYPE_NULL

public static final int TYPE_NULL
See Also:
Constant Field Values

TYPE_SHORT

public static final int TYPE_SHORT
See Also:
Constant Field Values

TYPE_STRING

public static final int TYPE_STRING
See Also:
Constant Field Values

TYPE_VECTOR

public static final int TYPE_VECTOR
See Also:
Constant Field Values
Constructor Detail

BinUtil

public BinUtil()
Method Detail

checkType

protected static void checkType(int got,
                                int want)
                         throws IOException
Throws:
IOException

load

public Object load(InputStream in)
            throws IOException
Throws:
IOException

readArray

protected Object[] readArray(DataInputStream in2)
                      throws IOException
Throws:
IOException

readBytes

protected byte[] readBytes(DataInputStream in2)
                    throws IOException
Throws:
IOException

readHashtable

protected Hashtable readHashtable(DataInputStream in2)
                           throws IOException
Throws:
IOException

readObject

protected Object readObject(DataInputStream in2)
                     throws IOException
Throws:
IOException

readObject

protected Object readObject(DataInputStream in2,
                            int type,
                            int size)
                     throws IOException
Throws:
IOException

readVector

protected Vector readVector(DataInputStream in2)
                     throws IOException
Throws:
IOException

save

public void save(OutputStream out,
                 Object obj)
          throws IOException
Throws:
IOException

skipUnknownObjects

protected void skipUnknownObjects(DataInputStream in,
                                  int num)
                           throws IOException
Throws:
IOException

writeArray

protected void writeArray(DataOutputStream out,
                          Object[] object)
                   throws IOException
Throws:
IOException

writeBytes

protected void writeBytes(DataOutputStream out,
                          byte[] bytes)
                   throws IOException
Throws:
IOException

writeHashtable

protected void writeHashtable(DataOutputStream out,
                              Hashtable hashtable)
                       throws IOException
Throws:
IOException

writeObject

protected void writeObject(DataOutputStream out,
                           Object obj)
                    throws IOException
Throws:
IOException

writeVector

protected void writeVector(DataOutputStream out,
                           Vector vector)
                    throws IOException
Throws:
IOException