/*
@see
com.ibm.ws.http.channel.internal.HttpBaseMessageImpl#readExternal(java.
io.ObjectInput)
486933
@Override
    public void readExternal(ObjectInput input) throws IOException, ClassNotFoundException {

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "De-serializing into: " + this);
        }
        super.readExternal(input);
        deserializeMethod(input);
        deserializeScheme(input);
        this.myURIBytes = readByteArray(input);
        setQueryString(readByteArray(input));
    }
550316
@Override
    public void readExternal(ObjectInput in)
        throws IOException, ClassNotFoundException {

        int header = in.readByte();

        switch (header) {
            case NEGATIVE_DAY_OF_MONTH_PATTERN_TYPE:
                this.obj = readPattern(in);
                break;
            default:
                throw new StreamCorruptedException("Unknown serialized type.");
        }

    }
1138002
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
        ObjectInputStream.GetField fields = in.readFields();
        String language = (String)fields.get("language", "");
        String script = (String)fields.get("script", "");
        String country = (String)fields.get("country", "");
        String variant = (String)fields.get("variant", "");
        String extStr = (String)fields.get("extensions", "");
        baseLocale = BaseLocale.getInstance(convertOldISOCodes(language), script, country, variant);
        if (extStr != null && extStr.length() > 0) {
            try {
                InternalLocaleBuilder bldr = new InternalLocaleBuilder();
                bldr.setExtensions(extStr);
                localeExtensions = bldr.getLocaleExtensions();
            } catch (LocaleSyntaxException e) {
                throw new IllformedLocaleException(e.getMessage());
            }
        } else {
            localeExtensions = null;
        }
    }
180874
@Override
    public void readExternal(ObjectInput input) throws IOException, ClassNotFoundException {

        // recreate the local header storage
        int len = input.readInt();
        if (SERIALIZATION_V2 == len) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Deserializing a V2 object");
            }
            this.deserializationVersion = SERIALIZATION_V2;
            len = input.readInt();
        }
        this.storage = new HashMap<Integer, HeaderElement>();

        // now read all of the headers
        int number = input.readInt();
        if (SERIALIZATION_V2 == this.deserializationVersion) {
            // this is the new format
            for (int i = 0; i < number; i++) {
                appendHeader(readByteArray(input), readByteArray(input));
            }
        } else {
            // this is the old format
            for (int i = 0; i < number; i++) {
                appendHeader((String) input.readObject(), (String) input.readObject());
            }
        }
    }
51977
static ZoneRules readExternal(DataInput in) throws IOException, ClassNotFoundException {
        int stdSize = in.readInt();
        long[] stdTrans = (stdSize == 0) ? EMPTY_LONG_ARRAY
                                         : new long[stdSize];
        for (int i = 0; i < stdSize; i++) {
            stdTrans[i] = Ser.readEpochSec(in);
        }
        ZoneOffset[] stdOffsets = new ZoneOffset[stdSize + 1];
        for (int i = 0; i < stdOffsets.length; i++) {
            stdOffsets[i] = Ser.readOffset(in);
        }
        int savSize = in.readInt();
        long[] savTrans = (savSize == 0) ? EMPTY_LONG_ARRAY
                                         : new long[savSize];
        for (int i = 0; i < savSize; i++) {
            savTrans[i] = Ser.readEpochSec(in);
        }
        ZoneOffset[] savOffsets = new ZoneOffset[savSize + 1];
        for (int i = 0; i < savOffsets.length; i++) {
            savOffsets[i] = Ser.readOffset(in);
        }
        int ruleSize = in.readByte();
        ZoneOffsetTransitionRule[] rules = (ruleSize == 0) ?
            EMPTY_LASTRULES : new ZoneOffsetTransitionRule[ruleSize];
        for (int i = 0; i < ruleSize; i++) {
            rules[i] = ZoneOffsetTransitionRule.readExternal(in);
        }
        return new ZoneRules(stdTrans, stdOffsets, savTrans, savOffsets, rules);
    }
1334079
public void readExternal(ObjectInput in) throws IOException,
			ClassNotFoundException {

		try {
			calleeCSeq = in.readLong();
			callerCSeq = in.readLong();
			calleeContact = SipFactoryImpl.addressFactory.createURI(in.readUTF());
			callerContact = SipFactoryImpl.addressFactory.createURI(in.readUTF());

			int routeSetSize = in.readInt();
			for (int i = 0; i < routeSetSize; i++) {
				javax.sip.address.Address route = SipFactoryImpl.addressFactory.createAddress(in.readUTF());
				callerRouteSet.add(route);
			} 

			routeSetSize = in.readInt();
			for (int i = 0; i < routeSetSize; i++) {
				javax.sip.address.Address route = SipFactoryImpl.addressFactory.createAddress(in.readUTF());
				calleeRouteSet.add(route);
			} 

			javax.sip.address.Address toAddress = SipFactoryImpl.addressFactory.createAddress(in.readUTF());
			toHeader = (To) SipFactoryImpl.headerFactory.createToHeader(toAddress, in.readUTF());

			javax.sip.address.Address fromAddress = SipFactoryImpl.addressFactory.createAddress(in.readUTF());
			fromHeader = (From) SipFactoryImpl.headerFactory.createFromHeader(fromAddress, in.readUTF());
			callId = in.readUTF();
		} catch (ParseException e) {
			throw new IllegalArgumentException("Problem occurred while unserializing ProxyTerminationInfo", e);
		}
	}
50985
public void readExternal(PofReader reader)
            throws IOException {
        name = reader.readString(0);
        last = reader.readLong(1);
    }
284552
@Override
  public void writeExternal(ObjectOutput out) throws IOException {
    super.writeExternal(out);
    out.writeBoolean(isLeaf);
    out.writeInt(numEntries);
    // Entries will be written in subclasses
  }
743565
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
        comparator = (Comparator) in.readObject();
        elements = (Activation[]) in.readObject();
        size = in.readInt();
    }
418686
public void writeExternal(java.io.ObjectOutput out)
        throws java.io.IOException
    {
        HashMap map = new HashMap(this);
        out.writeObject(map);
    }
426928
public void readExternal(PofReader reader) throws IOException {
        expression = (Expression<T>) reader.readObject(0);
        reader.readMap(1, variables);
    }
816387
@SuppressWarnings("unchecked")
    public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
    {
        _functions = (Map<String, Function>) in.readObject();
    }
773327
public void readExternal(PofReader reader)
            throws IOException {
        super.readExternal(reader);
        navigator = (PofNavigator) reader.readObject(0);
    }
827626
public void writeExternal(ObjectOutput out) throws IOException {
		super.writeExternal(out);
		if(linkedRequest == null) {
			out.writeBoolean(false);
		} else {
			out.writeBoolean(true);
			out.writeObject(linkedRequest);
		}
		out.writeBoolean(createDialog);
		if(routingDirective != null) {
			out.writeUTF(routingDirective.toString());
		} else {
			out.writeUTF("");
		}
		if(routingState != null) {
			out.writeUTF(routingState.toString());
		} else {
			out.writeUTF("");
		}
		if(routingRegion != null) {
			out.writeBoolean(true);
			out.writeObject(routingRegion);
		} else {
			out.writeBoolean(false);
		}
		out.writeBoolean(isInitial);
		if(logger.isDebugEnabled()) {
            logger.debug("writeExternal - isInitial=" + isInitial);
        }
		out.writeBoolean(isFinalResponseGenerated);
		out.writeBoolean(is1xxResponseGenerated);
	}
432912
public void writeExternal(ObjectOutput out) throws IOException
   {
      out.writeInt(eventType);

      byte[] buff = sessionId.getBytes(Constants.DEFAULT_ENCODING);
      out.writeInt(buff.length);
      out.write(buff);

      int listSize = items.size();
      out.writeInt(listSize);
      for (int i = 0; i < listSize; i++)
      {
         out.writeObject(items.get(i));
      }

      if (pairId != null)
      {
         out.writeInt(NOT_NULL_VALUE);
         buff = pairId.getBytes(Constants.DEFAULT_ENCODING);
         out.writeInt(buff.length);
         out.write(buff);
      }
      else
      {
         out.writeInt(NULL_VALUE);
      }
   }
805404
public void readExternal(ObjectInput in)
                    throws IOException, ClassNotFoundException {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.entry(tc, "readExternal");

        try {
            // read magic
            short magic = in.readShort();
            short majorVersion = in.readShort();
            short minorVersion = in.readShort();

            if (!(magic == EXTERNAL_MAGIC)) {

                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    Tr.debug(tc,
                             "Magic Number absent, trying default Java deserialization");
                throw new IOException("Bean ID externalized stream format error");

            } else if (!(majorVersion == MAJOR_VERSION) ||
                       !(minorVersion == MINOR_VERSION)) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    Tr.debug(tc,
                             "BeanID Version mismatch", new Object[] { new Short(majorVersion),
                                                                      new Short(minorVersion) });
                throw new IOException("BeanID version mismatch");
            }

            // read the interface type (HOME or REMOTE)
            byte ifType = in.readByte();
            if (ifType == IF_HOME) {
                _isHome = true;
            } else {
                _isHome = false;
            }

            //89554
            // read the bean name
            byte[] j2eeNameBytes = readExternalJ2EEName(in);

            // read the serialized primary key
            pkey = readExternalPKey(in, j2eeNameBytes);

            // TAKE CARE! We don't have a container reference so can't
            // restore transient fields.
            // This is ok as long
            // as rest of container restores BeanIds using the deserialise
            // method. Since readExternal
            // is a new addition
            // this can be no different to the behaviour that would have been
            // observed when using
            // the default serialization.

        } finally {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                Tr.exit(tc, "readExternal");
        }
    }
962697
@Override
    public void writeExternal(ObjectOutput out) throws IOException {
        out.writeByte(type);
        switch (type) {
            case BIG_MONEY: {
                BigMoney obj = (BigMoney) object;
                writeBigMoney(out, obj);
                return;
            }
            case MONEY: {
                Money obj = (Money) object;
                writeBigMoney(out, obj.toBigMoney());
                return;
            }
            case CURRENCY_UNIT: {
                CurrencyUnit obj = (CurrencyUnit) object;
                writeCurrency(out, obj);
                return;
            }
        }
        throw new InvalidClassException("Joda-Money bug: Serialization broken");
    }