Code example for ObjectInput

Methods: readUnsignedByte

0
      MarshallUtil.marshallMap(map, output);
   } 
 
   @Override 
   public Map readObject(ObjectInput input) throws IOException, ClassNotFoundException {
      int magicNumber = input.readUnsignedByte();
      Map subject = null;
      switch (magicNumber) {
         case HASHMAP:
            subject = new HashMap();
            break; 
         case TREEMAP:
            subject = new TreeMap();
            break; 
         case FASTCOPYHASHMAP:
            subject = new FastCopyHashMap();
            break; 
      } 
      MarshallUtil.unmarshallMap(subject, input);
      return subject;
Contextual code suggestions in your IDE  Get Codota for Java