View Javadoc

1   /*
2    * $Id: StreamDataSource.java,v 1.2 2004/11/27 13:20:02 pah Exp $
3    * 
4    * Created on 09-Nov-2004 by Paul Harrison (pah@jb.man.ac.uk)
5    * Copyright 2004 AstroGrid. All rights reserved.
6    *
7    * This software is published under the terms of the AstroGrid 
8    * Software License version 1.2, a copy of which has been included 
9    * with this distribution in the LICENSE.txt file.  
10   *
11   */ 
12  
13  package org.astrogrid.applications.apps.tables;
14  
15  import java.io.IOException;
16  import java.io.InputStream;
17  
18  import uk.ac.starlink.util.DataSource;
19  
20  /***
21   * A simple Datasource object that can be created from a standard stream. Exists because we have streams already created in CEA framework and all the standard STIL datasources take files/urls etc....
22   * @author Paul Harrison (pah@jb.man.ac.uk) 09-Nov-2004
23   * @version $Name: HEAD $
24   * @since iteration6
25   */
26  public class StreamDataSource extends DataSource {
27  
28    protected InputStream originalStream;
29     /***
30      * 
31      */
32     public StreamDataSource(InputStream stream) {
33      originalStream = stream;
34     }
35  
36     /* (non-Javadoc)
37      * @see uk.ac.starlink.util.DataSource#getRawInputStream()
38      */
39     protected InputStream getRawInputStream() throws IOException {
40       return originalStream;
41     }
42  
43  }