public int readPackedInt() throws IOException{ return LongPacker.unpackInt(this); } }
private static int[] deserializeArrayIntIInt(DataInputStream is) throws IOException { int size = LongPacker.unpackInt(is); int[] ret = new int[size]; for(int i=0;i<size;i++) ret[i] = is.readInt(); return ret; }
private static long[] deserializeArrayLongL(DataInputStream is) throws IOException { int size = LongPacker.unpackInt(is); long[] ret = new long[size]; for(int i=0;i<size;i++) ret[i] = is.readLong(); return ret; }
private static long[] deserializeArrayLongI(DataInputStream is) throws IOException { int size = LongPacker.unpackInt(is); long[] ret = new long[size]; for(int i=0;i<size;i++) ret[i] = is.readInt(); return ret; }
private static int[] deserializeArrayIntSInt(DataInputStream is) throws IOException { int size = LongPacker.unpackInt(is); int[] ret = new int[size]; for(int i=0;i<size;i++) ret[i] = is.readShort(); return ret; }
private static byte[] deserializeArrayByteInt(DataInputStream is) throws IOException { int size = LongPacker.unpackInt(is); byte[] b = new byte[size]; is.readFully(b); return b; }
private static long[] deserializeArrayLongS(DataInputStream is) throws IOException { int size = LongPacker.unpackInt(is); long[] ret = new long[size]; for(int i=0;i<size;i++) ret[i] = is.readShort(); return ret; }
static byte[] readByteArray( DataInputStream in ) throws IOException { int len = LongPacker.unpackInt(in); if ( len == 0 ) { return null; } byte[] buf = new byte[ len-1 ]; in.readFully( buf ); return buf; }
private static String deserializeString(DataInputStream buf) throws IOException { int len = LongPacker.unpackInt(buf); byte[] b= new byte[len]; buf.readFully(b); return new String(b); }
private static int[] deserializeArrayIntBInt(DataInputStream is) throws IOException { int size = LongPacker.unpackInt(is); int[] ret = new int[size]; for(int i=0;i<size;i++){ ret[i] = is.read(); if(ret[i] <0) throw new EOFException(); } return ret; }
private static long[] deserializeArrayLongPack(DataInputStream is) throws IOException { int size = LongPacker.unpackInt(is); if (size < 0) throw new EOFException(); long[] ret = new long[size]; for(int i=0;i<size;i++){ ret[i] = LongPacker.unpackLong(is); } return ret; }
private static ArrayList<Object> deserializeArrayList(DataInputStream is) throws IOException, ClassNotFoundException { int size = LongPacker.unpackInt(is); ArrayList<Object> s = new ArrayList<Object>(size); for(int i = 0; i<size;i++) s.add(readObject(is)); return s; }
private static Vector<Object> deserializeVector(DataInputStream is) throws IOException, ClassNotFoundException { int size = LongPacker.unpackInt(is); Vector<Object> s = new Vector<Object>(size); for(int i = 0; i<size;i++) s.add(readObject(is)); return s; }
private static HashSet<Object> deserializeHashSet(DataInputStream is) throws IOException, ClassNotFoundException { int size = LongPacker.unpackInt(is); HashSet<Object> s = new HashSet<Object>(size); for(int i = 0; i<size;i++) s.add(readObject(is)); return s; }
private static TreeSet<Object> deserializeTreeSet(DataInputStream is) throws IOException, ClassNotFoundException { int size = LongPacker.unpackInt(is); TreeSet<Object> s = new TreeSet<Object>(); Comparator comparator = (Comparator) readObject(is); if(comparator!=null) s = new TreeSet<Object>(comparator); for(int i = 0; i<size;i++) s.add(readObject(is)); return s; }
private static HashMap<Object,Object> deserializeHashMap(DataInputStream is) throws IOException, ClassNotFoundException { int size = LongPacker.unpackInt(is); HashMap<Object,Object> s = new HashMap<Object,Object>(size); for(int i = 0; i<size;i++) s.put(readObject(is),readObject(is)); return s; }
private static LinkedHashMap<Object,Object> deserializeLinkedHashMap(DataInputStream is) throws IOException, ClassNotFoundException { int size = LongPacker.unpackInt(is); LinkedHashMap<Object,Object> s = new LinkedHashMap<Object,Object>(size); for(int i = 0; i<size;i++) s.put(readObject(is),readObject(is)); return s; }
private static Hashtable<Object,Object> deserializeHashtable(DataInputStream is) throws IOException, ClassNotFoundException { int size = LongPacker.unpackInt(is); Hashtable<Object,Object> s = new Hashtable<Object,Object>(size); for(int i = 0; i<size;i++) s.put(readObject(is),readObject(is)); return s; }
private static Properties deserializeProperties(DataInputStream is) throws IOException, ClassNotFoundException { int size = LongPacker.unpackInt(is); Properties s = new Properties(); for(int i = 0; i<size;i++) s.put(readObject(is),readObject(is)); return s; }
private static TreeMap<Object,Object> deserializeTreeMap(DataInputStream is) throws IOException, ClassNotFoundException { int size = LongPacker.unpackInt(is); TreeMap<Object,Object> s = new TreeMap<Object,Object>(); Comparator comparator = (Comparator) readObject(is); if(comparator!=null) s = new TreeMap<Object,Object>(comparator); for(int i = 0; i<size;i++) s.put(readObject(is),readObject(is)); return s; }