< prev index next >

src/java.base/share/classes/sun/misc/URLClassPath.java

Print this page

        

@@ -37,10 +37,11 @@
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLConnection;
 import java.net.URLStreamHandler;
 import java.net.URLStreamHandlerFactory;
+import java.nio.ByteBuffer;
 import java.security.AccessControlException;
 import java.security.AccessController;
 import java.security.CodeSigner;
 import java.security.Permission;
 import java.security.PrivilegedExceptionAction;

@@ -797,10 +798,17 @@
                 public String getName() { return name; }
                 public URL getURL() { return url; }
                 public URL getCodeSourceURL() { return csu; }
                 public InputStream getInputStream() throws IOException
                     { return jar.getInputStream(entry); }
+                @Override
+                public ByteBuffer getByteBuffer() throws IOException
+                    { return ByteBuffer.wrap(getBytes()); }
+                @Override
+                public byte[] getBytes() throws IOException {
+                    return zipAccess.getBytes(jar, entry);
+                }
                 public int getContentLength()
                     { return (int)entry.getSize(); }
                 public Manifest getManifest() throws IOException
                     { return jar.getManifest(); };
                 public Certificate[] getCertificates()
< prev index next >