in = new DataInputStream(checkedIn);
load();
}
catch (IOException ioe)
{
throw new OperationFailedException("I/O failure: " + ioe.toString());
}
}
else
if (getMode() == CodecMode.SAVE)
{
try
{
PixelImage image = getImage();
if (image == null)
{
throw new MissingParameterException("Need image for saving.");
}
out = getOutputAsDataOutput();
if (out == null)
{
throw new MissingParameterException("Could not retrieve non-null DataOutput object for saving.");
}
setBoundsIfNecessary(image.getWidth(), image.getHeight());
save();
}
catch (IOException ioe)
{
throw new OperationFailedException("I/O failure: " + ioe.toString());
}
}
else
{
throw new OperationFailedException("Unknown codec mode: " + getMode());
}
}