summaryrefslogtreecommitdiffstats
path: root/libjava/classpath/java/net/URLClassLoader.java
diff options
context:
space:
mode:
authormark <mark@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-18 00:59:33 +0000
committermark <mark@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-18 00:59:33 +0000
commit15d27402f51cf831d82aa31271f5c01855b4f2cf (patch)
tree4c44aaa3ed1ee1b4f15732664c05cfc9214e1fa9 /libjava/classpath/java/net/URLClassLoader.java
parent820206ad46c6fc0131d5771ec1051267022e875d (diff)
downloadppe42-gcc-15d27402f51cf831d82aa31271f5c01855b4f2cf.tar.gz
ppe42-gcc-15d27402f51cf831d82aa31271f5c01855b4f2cf.zip
Imported GNU Classpath gcj-import-20051117.
* gnu/java/net/protocol/file/Connection.java: Removed, fully merged. * sources.am: Regenerated. * Makefile.in: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@107153 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/java/net/URLClassLoader.java')
-rw-r--r--libjava/classpath/java/net/URLClassLoader.java98
1 files changed, 49 insertions, 49 deletions
diff --git a/libjava/classpath/java/net/URLClassLoader.java b/libjava/classpath/java/net/URLClassLoader.java
index 726778eba0f..9d0e5041006 100644
--- a/libjava/classpath/java/net/URLClassLoader.java
+++ b/libjava/classpath/java/net/URLClassLoader.java
@@ -536,15 +536,15 @@ public class URLClassLoader extends SecureClassLoader
Resource getResource(String name)
{
try
- {
- File file = new File(dir, name).getCanonicalFile();
- if (file.exists() && !file.isDirectory())
- return new FileResource(this, file);
- }
+ {
+ File file = new File(dir, name).getCanonicalFile();
+ if (file.exists() && !file.isDirectory())
+ return new FileResource(this, file);
+ }
catch (IOException e)
- {
- // Fall through...
- }
+ {
+ // Fall through...
+ }
return null;
}
}
@@ -873,47 +873,47 @@ public class URLClassLoader extends SecureClassLoader
// construct the class (and watch out for those nasty IOExceptions)
try
{
- byte[] data;
- InputStream in = resource.getInputStream();
- try
- {
- int length = resource.getLength();
- if (length != -1)
- {
- // We know the length of the data.
- // Just try to read it in all at once
- data = new byte[length];
- int pos = 0;
- while (length - pos > 0)
- {
- int len = in.read(data, pos, length - pos);
- if (len == -1)
- throw new EOFException("Not enough data reading from: "
- + in);
- pos += len;
- }
- }
- else
- {
- // We don't know the data length.
- // Have to read it in chunks.
- ByteArrayOutputStream out = new ByteArrayOutputStream(4096);
- byte[] b = new byte[4096];
- int l = 0;
- while (l != -1)
- {
- l = in.read(b);
- if (l != -1)
- out.write(b, 0, l);
- }
- data = out.toByteArray();
- }
- }
- finally
- {
- in.close();
- }
- final byte[] classData = data;
+ byte[] data;
+ InputStream in = resource.getInputStream();
+ try
+ {
+ int length = resource.getLength();
+ if (length != -1)
+ {
+ // We know the length of the data.
+ // Just try to read it in all at once
+ data = new byte[length];
+ int pos = 0;
+ while (length - pos > 0)
+ {
+ int len = in.read(data, pos, length - pos);
+ if (len == -1)
+ throw new EOFException("Not enough data reading from: "
+ + in);
+ pos += len;
+ }
+ }
+ else
+ {
+ // We don't know the data length.
+ // Have to read it in chunks.
+ ByteArrayOutputStream out = new ByteArrayOutputStream(4096);
+ byte[] b = new byte[4096];
+ int l = 0;
+ while (l != -1)
+ {
+ l = in.read(b);
+ if (l != -1)
+ out.write(b, 0, l);
+ }
+ data = out.toByteArray();
+ }
+ }
+ finally
+ {
+ in.close();
+ }
+ final byte[] classData = data;
// Now get the CodeSource
final CodeSource source = resource.getCodeSource();
OpenPOWER on IntegriCloud