View Javadoc
1   package com.atlassian.plugin.classloader.url;
2   
3   import java.io.ByteArrayInputStream;
4   import java.io.InputStream;
5   import java.net.URL;
6   import java.net.URLConnection;
7   
8   /**
9    * URL connection from a byte array
10   */
11  public class BytesUrlConnection extends URLConnection {
12      private final byte[] content;
13  
14      public BytesUrlConnection(URL url, byte[] content) {
15          super(url);
16          this.content = content;
17      }
18  
19      public void connect() {
20      }
21  
22      public InputStream getInputStream() {
23          return new ByteArrayInputStream(content);
24      }
25  }