Prevent java.io.IOException raising