View Javadoc

1   package org.codehaus.classworlds;
2   
3   import java.net.URLStreamHandler;
4   import java.net.URLConnection;
5   import java.net.URL;
6   
7   /***
8    * @author Hani Suleiman (hani@formicary.net)
9    *         Date: Oct 20, 2003
10   *         Time: 12:45:18 AM
11   */
12  public class BytesURLStreamHandler extends URLStreamHandler
13  {
14      byte[] content;
15  
16      int offset;
17  
18      int length;
19  
20      public BytesURLStreamHandler( byte[] content )
21      {
22          this.content = content;
23      }
24  
25      public URLConnection openConnection( URL url )
26      {
27          return new BytesURLConnection( url, content );
28      }
29  }