* The InputStream *must* support mark!
*/
public void unpack(ISOComponent c, InputStream in) throws IOException, ISOException {
if (!in.markSupported()){
throw new ISOException("InputStream passed to ISOMultFieldPackager *must* support the mark method.");
}
ListIterator i = possibles.listIterator();
// Save our position in the InputStream
in.mark(1024);
while (i.hasNext()) {
in.reset();
try {
// One of our possibles will succeed in it's unpack from this Stream.
current = (ISOFieldPackager) i.next();
current.unpack(c,in);
return ;
} catch (ISOException eok) {
// This one failed.
current = null;
}
catch (IOException eok) {
// This one failed.
current = null;
}
}
throw new ISOException("unpack failed to find a match in the possible List!");
}