View Javadoc

1   package com.atlassian.plugin.classloader.url;
2   
3   import java.net.URL;
4   import java.net.URLConnection;
5   import java.io.InputStream;
6   import java.io.ByteArrayInputStream;
7   
8   /**
9    * Created by IntelliJ IDEA.
10   * User: sleberrigaud
11   * Date: May 9, 2008
12   * Time: 11:06:59 AM
13   * To change this template use File | Settings | File Templates.
14   */
15  public class BytesUrlConnection extends URLConnection
16  {
17      private final byte[] content;
18  
19      public BytesUrlConnection(URL url, byte[] content)
20      {
21          super(url);
22          this.content = content;
23      }
24  
25      public void connect()
26      {
27      }
28  
29      public InputStream getInputStream()
30      {
31          return new ByteArrayInputStream(content);
32      }
33  }