View Javadoc

1   package com.atlassian.plugin.classloader.url;
2   
3   import java.net.URLConnection;
4   import java.net.URL;
5   import java.net.URLStreamHandler;
6   
7   /**
8    * URL stream handler of a byte array
9    */
10  public class BytesUrlStreamHandler extends URLStreamHandler
11  {
12      private final byte[] content;
13  
14      public BytesUrlStreamHandler(byte[] content)
15      {
16          this.content = content;
17      }
18  
19      public URLConnection openConnection(URL url)
20      {
21          return new BytesUrlConnection(url, content);
22      }
23  }