Esempio n. 1
0
 public static Compression guessCompressionMethod(byte [] bits){
   AutoBuffer ab = new AutoBuffer(bits);
   // Look for ZIP magic
   if( bits.length > ZipFile.LOCHDR && ab.get4(0) == ZipFile.LOCSIG )
     return Compression.ZIP;
   if( bits.length > 2 && ab.get2(0) == GZIPInputStream.GZIP_MAGIC )
     return Compression.GZIP;
   return Compression.NONE;
 }
Esempio n. 2
0
 @Override public IcedHashMap<K,V> read(AutoBuffer bb) {
   int n = bb.get4();
   for(int i = 0; i < n; ++i)
     put(bb.<K>get(),bb.<V>get());
   return this;
 }
Esempio n. 3
0
 @Override public IcedArrayList<T> read(AutoBuffer bb) {
   int n = bb.get4();
   for(int i = 0; i < n; ++i)
     add(bb.<T>get());
   return this;
 }