summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2009-12-17 20:35:44 +0000
committerPaul Phillips <paulp@improving.org>2009-12-17 20:35:44 +0000
commita25195fc1f025c0c9515b10af20c9327b0733ffa (patch)
tree1e9a68ddc09a54b068fe9b999c038c6b40a57bf7 /src/compiler
parent3b620e31d3ad51df46c99ca02347ca292097278e (diff)
downloadscala-a25195fc1f025c0c9515b10af20c9327b0733ffa.tar.gz
scala-a25195fc1f025c0c9515b10af20c9327b0733ffa.tar.bz2
scala-a25195fc1f025c0c9515b10af20c9327b0733ffa.zip
Added a method to turn a class name into the pi...
Added a method to turn a class name into the pile of bytes which is its classfile on disk. no review.
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/nsc/util/ScalaClassLoader.scala8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/util/ScalaClassLoader.scala b/src/compiler/scala/tools/nsc/util/ScalaClassLoader.scala
index 95396dd95b..95110d6b81 100644
--- a/src/compiler/scala/tools/nsc/util/ScalaClassLoader.scala
+++ b/src/compiler/scala/tools/nsc/util/ScalaClassLoader.scala
@@ -90,4 +90,12 @@ object ScalaClassLoader {
search(getContextLoader())
}
+
+ def findBytesForClassName(s: String): Array[Byte] = {
+ val name = s.replaceAll("""\.""", "/") + ".class"
+ val url = getSystemLoader.getResource(name)
+
+ if (url == null) Array()
+ else new io.Streamable.Bytes { def inputStream() = url.openStream } . toByteArray()
+ }
}