Problems w NetcdfFile.openInMemory

_From owner-netcdf-java@xxxxxxxxxxxxxxxx Mon Jun 27 16:52:23 2005
Received: (from majordo@localhost)
        by unidata.ucar.edu (UCAR/Unidata) id j5RMoxa8020304
        for netcdf-java-out; Mon, 27 Jun 2005 16:50:59 -0600 (MDT)
Received: from snark.apl.washington.edu (postfix@xxxxxxxxxxxxxxxxxxxxxxxx 
[128.208.78.3])
        by unidata.ucar.edu (UCAR/Unidata) with ESMTP id j5RMouW4020298
        for <netcdf-java@xxxxxxxxxxxxxxxx>; Mon, 27 Jun 2005 16:50:56 -0600 
(MDT)
Organization: UCAR/Unidata
Keywords: 200506272250.j5RMouW4020298
Received: by snark.apl.washington.edu (Postfix, from userid 10643)
        id C52DE97824; Mon, 27 Jun 2005 15:50:55 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1])
        by snark.apl.washington.edu (Postfix) with ESMTP id C24071C888
        for <netcdf-java@xxxxxxxxxxxxxxxx>; Mon, 27 Jun 2005 15:50:55 -0700 
(PDT)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Spam-Checker-Version: SpamAssassin 3.0.1 (2004-10-22) on 
        laraine.unidata.ucar.edu
X-Spam-Level: 
X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,SPF_SOFTFAIL 
        autolearn=no version=3.0.1
Sender: owner-netcdf-java@xxxxxxxxxxxxxxxx
Precedence: bulk

I'm trying to load netcdf data in an app with no local 'filesystem', such
as a jnlp (web start) environment.  Looks like the best bet, given the
Java Netcdf API, is to locate the data as as resource
(Class.getResourceAsStream). I can thus get the data into a byte[].

But passing that byte[] to NetcdfFile.openInMemory fails with a NPE.
Looking at the latest (2.2.09) sources, it seems that the
InMemoryRandomAccessFile is broken.  The 'buffer' attribute is attached to
the incoming data buf only after a call to 'init(1)' occurs.  The
superclass RandomAccessFile is thus is a bad state, causing an eventual
NPE.

Any help gratefully apprteciated,

Stuart


  • 2005 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdf-java archives: