KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > osgi > framework > adaptor > core > ReferenceInputStream


1 /*******************************************************************************
2  * Copyright (c) 2004 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11
12 package org.eclipse.osgi.framework.adaptor.core;
13
14 import java.io.IOException JavaDoc;
15 import java.io.InputStream JavaDoc;
16 import java.net.URL JavaDoc;
17
18 /**
19  * InputStream subclass which provides a reference (via URL) to the data
20  * rather than allowing the input stream to be directly read.
21  */

22 public class ReferenceInputStream extends InputStream JavaDoc {
23     protected URL JavaDoc reference;
24
25     public ReferenceInputStream(URL JavaDoc reference) {
26         this.reference = reference;
27     }
28
29     /* This method should not be called.
30      */

31     public int read() throws IOException JavaDoc {
32         throw new IOException JavaDoc();
33     }
34
35     public URL JavaDoc getReference() {
36         return reference;
37     }
38 }
Popular Tags