NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

Re: quick question

NOTE: The decoders mailing list is no longer active. The list archives are made available for historical reasons.

On Wed, 8 Feb 2006, Nelson Brandon K A1C AFWA/SCSA wrote:

> Robb,
>
>
>
>             Is there anyway to use an http URL as the file source when
> making the random access file?

Nelson,

yes, i also attached the HTTPRandomAccessFile3 file and the tomcat lib
that's needed.


    if (uriString.startsWith("http:")) { // open through URL
      raf = new ucar.unidata.io.http.HTTPRandomAccessFile3(uriString);

robb...
>
>
>
> Ex:
>
>         Grib1Indexer g1d = new Grib1Indexer();
>
>
>
>         //RandomAccessFile for faster reading of the index file
>
> ===>RandomAccessFile raf = new RandomAccessFile(gribFile, "r");
>
>         raf.order(RandomAccessFile.BIG_ENDIAN);
>
>
>
>         //File stream for writing of the index file
>
>         PrintStream ps = new PrintStream(new FilterOutputStream(
>
>                 new FileOutputStream(outfile, false)));
>
>
>
>         //Writes the index file
>
>         g1d.writeFileIndex(raf, ps, false);
>
>         } catch (Exception e) {
>
>             e.printStackTrace();
>
>         }
>
>
>
> V/r
>
> A1C Nelson, Brandon K
>
> Communications-Computer Systems Programmer
>
> HQ AFWA/SCSA (402) 294-1404
>
>
>
>

==============================================================================
Robb Kambic                                Unidata Program Center
Software Engineer III                      Univ. Corp for Atmospheric Research
rkambic@xxxxxxxxxxxxxxxx                   WWW: http://www.unidata.ucar.edu/
==============================================================================
  • 2006 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the decoders archives: