比如文件不存在、读取的文件流、网络流字符有问题都会导致
查看API IOException 发现IOException的直接子类
ChangedCharSetException,
CharacterCodingException,
CharConversionException,
ClosedChannelException,
EOFException,
FileLockInterruptionException,
FileNotFoundException, FilerException,
HttpRetryException, IIOException, InterruptedIOException, InvalidPropertiesFormatException,
JMXProviderException,
JMXServerErrorException,
MalformedURLException, ObjectStreamException, ProtocolException, RemoteException, SaslException, SocketException, SSLException, SyncFailedException, UnknownHostException, UnknownServiceException,
UnsupportedDataTypeException,
UnsupportedEncodingException,
UTFDataFormatException, ZipException
每一种异常都对应着相应的情况,对照API好好学习一下
一般对文件进行处理应该说与io流发生联系的都会