void error(@CheckForNull Throwable e) throws IOException
InputStreamto report an error.
This method is somewhat like
in that it signals the end of a stream. In addition to what the close method does,
this method will cause the
method (or any other overloaded versions) to throw an
IOException with the given throwable as the cause.
InputStream will report an error only after all the data that has written
before is read. IOW, the error will not magically jump over the data that was written.
This is useful to propagate error over a pipe. If used over
a channel with the remoting library that doesn't yet support this,
or if the
OutputStream isn't connecting to an
this method behaves exactly like
OutputStream is already closed or error state is
set, this method will be no-op.
Copyright © 2004–2021. All rights reserved.