Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Types of errors when receiving IOException  RSS feed

 
Castor Tack
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there:

I know that IOException is a general exception. I'm getting one. What types of errors does the IOException class cover?
For example: when I get FileNotFoundException, I know the file doesn't exit because that's the type of error the class covers.


Thanks
 
Greg Brannon
Bartender
Posts: 563
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It means that you've had an Input/Output error. Either your program couldn't read from something or write to something that you programed it to read from or write to. There are a variety of reasons this might have occurred. Show us some code if you want more help.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16059
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you have a look at the API documentation of IOException? It says:
API documentation wrote:Signals that an I/O exception of some sort has occurred. This class is the general class of exceptions produced by failed or interrupted I/O operations.

And there's a long list of subclasses, that are used for many different kinds of exceptions that might happen when doing I/O:
API documentation wrote:Direct Known Subclasses:

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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!