本文整理了Java中java.io.IOException
类的一些代码示例,展示了IOException
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IOException
类的具体详情如下:
包路径:java.io.IOException
类名称:IOException
[英]Signals a general, I/O-related error. Error details may be specified when calling the constructor, as usual. Note there are also several subclasses of this class for more specific error situations, such as FileNotFoundException or EOFException.
[中]表示与I/O相关的一般错误。通常,调用构造函数时可能会指定错误详细信息。注意,对于更具体的错误情况,例如FileNotFoundException或EOFEException,此类还有几个子类。
代码示例来源:origin: apache/zeppelin
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
代码示例来源:origin: square/retrofit
@Override public void networkError(IOException e) {
System.err.println("NETWORK ERROR " + e.getMessage());
}
代码示例来源:origin: square/okhttp
@Override public void onFailure(Call call, IOException e) {
e.printStackTrace();
}
代码示例来源:origin: ReactiveX/RxJava
@Override
public Maybe<Object> apply(Throwable v) throws Exception {
throw new IOException();
}
})
代码示例来源:origin: apache/incubator-dubbo
protected static TProtocol newProtocol(URL url, ChannelBuffer buffer) throws IOException {
String protocol = url.getParameter(ThriftConstants.THRIFT_PROTOCOL_KEY,
ThriftConstants.DEFAULT_PROTOCOL);
if (ThriftConstants.BINARY_THRIFT_PROTOCOL.equals(protocol)) {
return new TBinaryProtocol(new TIOStreamTransport(new ChannelBufferOutputStream(buffer)));
}
throw new IOException("Unsupported protocol type " + protocol);
}
代码示例来源:origin: square/okhttp
private static void sendRequest(OkHttpClient client, String url) {
System.out.printf("%-40s ", url);
System.out.flush();
System.out.println(Platform.get());
Request request = new Request.Builder().url(url).build();
try (Response response = client.newCall(request).execute()) {
Handshake handshake = response.handshake();
System.out.println(handshake.tlsVersion()
+ " "
+ handshake.cipherSuite()
+ " "
+ response.protocol()
+ " "
+ response.code
+ " "
+ response.body.bytes().length
+ "b");
} catch (IOException ioe) {
System.out.println(ioe.toString());
}
}
}
代码示例来源:origin: ReactiveX/RxJava
@Override
public Integer apply(Integer v) throws Exception {
throw new IOException();
}
})
代码示例来源:origin: apache/incubator-dubbo
protected static TProtocol newProtocol(URL url, ChannelBuffer buffer) throws IOException {
String protocol = url.getParameter(ThriftConstants.THRIFT_PROTOCOL_KEY,
ThriftConstants.DEFAULT_PROTOCOL);
if (ThriftConstants.BINARY_THRIFT_PROTOCOL.equals(protocol)) {
return new TBinaryProtocol(new TIOStreamTransport(new ChannelBufferOutputStream(buffer)));
}
throw new IOException("Unsupported protocol type " + protocol);
}
代码示例来源:origin: apache/incubator-dubbo
protected IOException expect(String expect, int ch)
throws IOException {
if (ch < 0)
return error("expected " + expect + " at end of file");
else {
_offset--;
try {
Object obj = readObject();
if (obj != null) {
return error("expected " + expect
+ " at 0x" + Integer.toHexString(ch & 0xff)
+ " " + obj.getClass().getName() + " (" + obj + ")");
} else
return error("expected " + expect
+ " at 0x" + Integer.toHexString(ch & 0xff) + " null");
} catch (IOException e) {
log.log(Level.FINE, e.toString(), e);
return error("expected " + expect
+ " at 0x" + Integer.toHexString(ch & 0xff));
}
}
}
代码示例来源:origin: apache/zeppelin
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
代码示例来源:origin: ReactiveX/RxJava
@Override
public boolean test(Integer v) throws Exception {
throw new IOException();
}
}).test().assertFailure(IOException.class);
代码示例来源:origin: spring-projects/spring-framework
private void handleProcessError(Resource resource, IOException ex) {
if (this.resolutionMethod != ResolutionMethod.FIRST_FOUND &&
this.resolutionMethod != ResolutionMethod.OVERRIDE_AND_IGNORE) {
throw new IllegalStateException(ex);
}
if (logger.isWarnEnabled()) {
logger.warn("Could not load map from " + resource + ": " + ex.getMessage());
}
}
代码示例来源:origin: jenkinsci/jenkins
@Override
public void printStackTrace(PrintStream s) {
super.printStackTrace(s);
for (IOException exception : exceptions) {
exception.printStackTrace(s);
}
}
代码示例来源:origin: redisson/redisson
/**
* Begins the HTTP service.
*/
public void run() {
System.err.println("ready to service...");
for (;;)
try {
ServiceThread th = new ServiceThread(this, socket.accept());
th.start();
}
catch (IOException e) {
logging(e.toString());
}
}
代码示例来源:origin: apache/zeppelin
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
代码示例来源:origin: ReactiveX/RxJava
@Override
public Subscriber apply(Flowable f, Subscriber s) throws Exception {
throw new IOException();
}
});
代码示例来源:origin: apache/incubator-dubbo
private void send(String msg) throws RemotingException {
DatagramPacket hi = new DatagramPacket(msg.getBytes(), msg.length(), mutilcastAddress, mutilcastSocket.getLocalPort());
try {
mutilcastSocket.send(hi);
} catch (IOException e) {
throw new IllegalStateException(e.getMessage(), e);
}
}
代码示例来源:origin: jenkinsci/jenkins
@Override
public void printStackTrace(PrintWriter s) {
super.printStackTrace(s);
for (IOException exception : exceptions) {
exception.printStackTrace(s);
}
}
代码示例来源:origin: commons-io/commons-io
/**
* find files.
*/
protected List<File> find(final File startDirectory) {
final List<File> results = new ArrayList<>();
try {
walk(startDirectory, results);
} catch (final IOException ex) {
fail(ex.toString());
}
return results;
}
代码示例来源:origin: apache/zeppelin
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
内容来源于网络,如有侵权,请联系作者删除!