240241242243244245246247248249250
HMapIFW m2 = new HMapIFW(); m2.put(3, 1.0f); m2.put(4, 1.0f); m2.put(5, 1.0f); byte[] bytes2 = m2.serialize(); HMapIFW n1 = HMapIFW.create(bytes1); HMapIFW n2 = HMapIFW.create(bytes2); assertFalse(n1.isDecoded());
271272273274275276277278279280281
HMapIFW m1 = new HMapIFW(); m1.put(3, 5.0f); m1.put(4, 22.0f); byte[] bytes1 = m1.serialize(); HMapIFW m2 = new HMapIFW(); m2.put(3, 1.0f); m2.put(4, 1.0f); m2.put(5, 1.0f);
278279280281282283284285286287288
311312313314315316317318319320321
// make sure this does nothing m1.decode(); assertTrue(m1.size() == 0); byte[] bytes = m1.serialize(); HMapIFW m2 = HMapIFW.create(bytes); assertTrue(m2.size() == 0); }
123124125126127128129130131132133
// make sure this does nothing m1.decode(); assertTrue(m1.size() == 0); HMapIFW m2 = HMapIFW.create(m1.serialize()); assertTrue(m2.size() == 0); } public static junit.framework.Test suite() {
192193194195196197198199200201202
// Make sure this does nothing. m1.decode(); assertEquals(0, m1.size()); Int2FloatMap m2 = Int2FloatOpenHashMapWritable.create(m1.serialize()); assertEquals(0, m2.size()); } @Test
// make sure this does nothing m1.decode(); assertEquals(0, m1.size()); Int2IntMap m2 = Int2IntOpenHashMapWritable.create(m1.serialize()); assertEquals(0, m2.size()); } @Test