{
final Object ob = oin.readObject();
// yes, that will be more generic in the future ...
if (ob instanceof External8BitEncodingData == false)
{
throw new ResourceCreationException("This is no 8Bit Encoding data");
}
final External8BitEncodingData encData = (External8BitEncodingData) ob;
final External8BitEncodingCore encCore =
new External8BitEncodingCore(encData);
return new SimpleResource(data.getKey(), encCore, data.getVersion(manager));
}
finally
{
oin.close();
}
}
catch (IOException e)
{
throw new ResourceLoadingException("Failed to load resource", e);
}
catch (ClassNotFoundException e)
{
throw new ResourceCreationException
("Missing class definition: Failed to create encoding.");
}
}