Code example for ObjectInput

Methods: readBoolean

0
  /** 
   * Supports Java Serialization. 
   */ 
  public void readExternal(ObjectInput objectInput) throws IOException {
    // Read the area code map storage strategy flag. 
    boolean useFlyweightMapStorage = objectInput.readBoolean();
    if (useFlyweightMapStorage) {
      areaCodeMapStorage = new FlyweightMapStorage();
    } else { 
      areaCodeMapStorage = new DefaultMapStorage();
    } 
    areaCodeMapStorage.readExternal(objectInput);
  } 
 
  /** 
   * Supports Java Serialization. 
   */ 
  public void writeExternal(ObjectOutput objectOutput) throws IOException {
    objectOutput.writeBoolean(areaCodeMapStorage.isFlyweight());
    areaCodeMapStorage.writeExternal(objectOutput);
Stop searching for code, let great code find you!  Add Codota to your java IDE