[399728] Don't assume that available == 0 means end of stream.
diff --git a/plugins/org.eclipse.emf.ecore.xmi/src/org/eclipse/emf/ecore/xmi/impl/XMLResourceImpl.java b/plugins/org.eclipse.emf.ecore.xmi/src/org/eclipse/emf/ecore/xmi/impl/XMLResourceImpl.java
index 473b256..d4a4516 100644
--- a/plugins/org.eclipse.emf.ecore.xmi/src/org/eclipse/emf/ecore/xmi/impl/XMLResourceImpl.java
+++ b/plugins/org.eclipse.emf.ecore.xmi/src/org/eclipse/emf/ecore/xmi/impl/XMLResourceImpl.java
@@ -206,15 +206,21 @@
       eObjectInputStream.loadResource(this);
 
       // Load the extrinsic ID map.
-      // If this stream wasn't produced by XMLResourceImpl, there won't be a map.
-      //
-      if (inputStream.available() > 0)
-      {
-        for (int i = 0, size = eObjectInputStream.readCompressedInt(); i < size; ++i)
-        {
-          setID(eObjectInputStream.loadEObject(), eObjectInputStream.readString());
-        }
-      }
+       int size = 0;
+       try
+       {
+         // If this stream wasn't produced by XMLResourceImpl, there won't be a map.
+         //
+         size = eObjectInputStream.readCompressedInt();
+       }
+       catch (IOException exception)
+       {
+         // Ignore
+       }
+       for (int i = 0; i < size; ++i)
+       {
+         setID(eObjectInputStream.loadEObject(), eObjectInputStream.readString());
+       }
 
       if (handler != null)
       {