public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { in.readByte(); // ignore version for now fieldNumber = in.readShort(); byte fieldType; ISOComponent c; try { while ((fieldType = in.readByte()) != 'E') { c = null; switch (fieldType) { case 'F': c = new ISOField(); break; case 'A': c = new ISOAmount(); break; case 'B': c = new ISOBinaryField(); break; case 'M': c = new ISOMsg(); break; case 'H': readHeader(in); break; case 'P': readPackager(in); break; case 'D': readDirection(in); break; default: throw new IOException("malformed ISOMsg"); } if (c != null) { ((Externalizable) c).readExternal(in); set(c); } } } catch (ISOException e) { throw new IOException(e.getMessage()); } }