Kaydet (Commit) 255e3002 authored tarafından Noel Grandin's avatar Noel Grandin

fix more Java1.5 incompatibility

Change-Id: I9c4d62e4d3703e4e1015efe2b2917d54f82bc83f
üst 3e5371ab
...@@ -55,7 +55,9 @@ public final class XInputStreamToInputStreamAdapter extends InputStream { ...@@ -55,7 +55,9 @@ public final class XInputStreamToInputStreamAdapter extends InputStream {
try { try {
bytesAvail = xin.available(); bytesAvail = xin.available();
} catch (Exception e) { } catch (Exception e) {
throw new IOException(e); IOException newEx = new IOException(e.getMessage());
newEx.initCause(e);
throw newEx;
} }
return(bytesAvail); return(bytesAvail);
...@@ -66,7 +68,9 @@ public final class XInputStreamToInputStreamAdapter extends InputStream { ...@@ -66,7 +68,9 @@ public final class XInputStreamToInputStreamAdapter extends InputStream {
try { try {
xin.closeInput(); xin.closeInput();
} catch (Exception e) { } catch (Exception e) {
throw new IOException(e); IOException newEx = new IOException(e.getMessage());
newEx.initCause(e);
throw newEx;
} }
} }
...@@ -87,7 +91,9 @@ public final class XInputStreamToInputStreamAdapter extends InputStream { ...@@ -87,7 +91,9 @@ public final class XInputStreamToInputStreamAdapter extends InputStream {
} }
} catch (Exception e) { } catch (Exception e) {
throw new IOException(e); IOException newEx = new IOException(e.getMessage());
newEx.initCause(e);
throw newEx;
} }
} }
...@@ -107,7 +113,9 @@ public final class XInputStreamToInputStreamAdapter extends InputStream { ...@@ -107,7 +113,9 @@ public final class XInputStreamToInputStreamAdapter extends InputStream {
System.arraycopy(tmp[0], 0, b, 0, b.length); System.arraycopy(tmp[0], 0, b, 0, b.length);
} }
} catch (Exception e) { } catch (Exception e) {
throw new IOException(e); IOException newEx = new IOException(e.getMessage());
newEx.initCause(e);
throw newEx;
} }
return (bytesRead); return (bytesRead);
...@@ -138,10 +146,10 @@ public final class XInputStreamToInputStreamAdapter extends InputStream { ...@@ -138,10 +146,10 @@ public final class XInputStreamToInputStreamAdapter extends InputStream {
} }
return ((int)bytesRead); return ((int)bytesRead);
} catch (Exception e) { } catch (Exception e) {
throw new IOException(e); IOException newEx = new IOException(e.getMessage());
newEx.initCause(e);
throw newEx;
} }
} }
...@@ -155,7 +163,9 @@ public final class XInputStreamToInputStreamAdapter extends InputStream { ...@@ -155,7 +163,9 @@ public final class XInputStreamToInputStreamAdapter extends InputStream {
try { try {
avail = xin.available(); avail = xin.available();
} catch (Exception e) { } catch (Exception e) {
throw new IOException(e); IOException newEx = new IOException(e.getMessage());
newEx.initCause(e);
throw newEx;
} }
do { do {
...@@ -170,7 +180,9 @@ public final class XInputStreamToInputStreamAdapter extends InputStream { ...@@ -170,7 +180,9 @@ public final class XInputStreamToInputStreamAdapter extends InputStream {
try { try {
xin.skipBytes(tmpIntVal); xin.skipBytes(tmpIntVal);
} catch (Exception e) { } catch (Exception e) {
throw new IOException(e); IOException newEx = new IOException(e.getMessage());
newEx.initCause(e);
throw newEx;
} }
} while (tmpLongVal > 0); } while (tmpLongVal > 0);
......
...@@ -53,7 +53,9 @@ public final class XOutputStreamToOutputStreamAdapter extends OutputStream { ...@@ -53,7 +53,9 @@ public final class XOutputStreamToOutputStreamAdapter extends OutputStream {
try { try {
xout.closeOutput(); xout.closeOutput();
} catch (Exception e) { } catch (Exception e) {
throw new IOException(e); IOException newEx = new IOException(e.getMessage());
newEx.initCause(e);
throw newEx;
} }
} }
...@@ -62,7 +64,9 @@ public final class XOutputStreamToOutputStreamAdapter extends OutputStream { ...@@ -62,7 +64,9 @@ public final class XOutputStreamToOutputStreamAdapter extends OutputStream {
try { try {
xout.flush(); xout.flush();
} catch (Exception e) { } catch (Exception e) {
throw new IOException(e); IOException newEx = new IOException(e.getMessage());
newEx.initCause(e);
throw newEx;
} }
} }
...@@ -72,7 +76,9 @@ public final class XOutputStreamToOutputStreamAdapter extends OutputStream { ...@@ -72,7 +76,9 @@ public final class XOutputStreamToOutputStreamAdapter extends OutputStream {
try { try {
xout.writeBytes(b); xout.writeBytes(b);
} catch (Exception e) { } catch (Exception e) {
throw new IOException(e); IOException newEx = new IOException(e.getMessage());
newEx.initCause(e);
throw newEx;
} }
} }
...@@ -88,7 +94,9 @@ public final class XOutputStreamToOutputStreamAdapter extends OutputStream { ...@@ -88,7 +94,9 @@ public final class XOutputStreamToOutputStreamAdapter extends OutputStream {
try { try {
xout.writeBytes(tmp); xout.writeBytes(tmp);
} catch (Exception e) { } catch (Exception e) {
throw new IOException(e); IOException newEx = new IOException(e.getMessage());
newEx.initCause(e);
throw newEx;
} }
} }
...@@ -101,7 +109,9 @@ public final class XOutputStreamToOutputStreamAdapter extends OutputStream { ...@@ -101,7 +109,9 @@ public final class XOutputStreamToOutputStreamAdapter extends OutputStream {
try { try {
xout.writeBytes(oneByte); xout.writeBytes(oneByte);
} catch (Exception e) { } catch (Exception e) {
throw new IOException(e); IOException newEx = new IOException(e.getMessage());
newEx.initCause(e);
throw newEx;
} }
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment