Re: [netcdf-java] Write to OutputStream

Hi Eric:

If you need to send a valid netcdf file, your best bet is to write the file to disk, then copy it to the output stream. If that becomes a performance bottleneck, then you could start to think about optimizing it.

Our "streaming" format is not a standard netcdf format, and would require a specialized client.

John

On 5/29/2014 8:12 AM, Ericson, Dean - 0443 - MITLL wrote:
John,

Do you have any Java examples on how to stream an entire netcdf file?  I've
been looking on the internet and have come across some of your presentations
where you say that streaming netcdf 4 'enhanced' file is not yet available
(granted that was in 2012 I believe), but have seen hints that is not the
case anymore.  I've been looking for relevant samples, but so far have been
unable to find anything concrete.

We are looking to read in a netcdf file (25MB test file to start with),
subset it according to a bounding box then put that newly
constructed/subsetted file onto a JMS topic.  I'm not sure if
Variable.readToStream() would work as we're looking to send the entire file,
not just a section of it.  Am I reading the documentation incorrectly?  Does
that method only provide for streaming sections of a file?  Would I have to
'loop over' the entire netcdf file, sending section by section?

Any help is greatly appreciated.


Thank you,
Dean Ericson

--------------------------
Dean Ericson
MIT Lincoln Laboratory





-----Original Message-----
From: netcdf-java-bounces@xxxxxxxxxxxxxxxx
[mailto:netcdf-java-bounces@xxxxxxxxxxxxxxxx] On Behalf Of John Caron
Sent: Wednesday, May 28, 2014 5:43 PM
To: netcdf-java@xxxxxxxxxxxxxxxx
Subject: Re: [netcdf-java] Write to OutputStream

Hi Dean:

You can try Variable.readToStream().

Note this will be a binary serialization that may not be portable. Who is
the consumer of the stream?

Also its "experimental", and we would be glad of feedback.

John

On 5/28/2014 2:24 PM, Ericson, Dean - 0443 - MITLL wrote:
Is anyone aware of a way that we can use the netcdf 4.3 library to
write/copy/subset a netcdf file into an OutputStream?  I see that the
NetcdfFile object has a 'writeCDL' method, but it looks as though it
has to exist on disk first.  Can anyone confirm that?

My use case requires that we can copy data from an input netcdf 4 file
and copy/subset it onto a JMS topic.  We have all other dependencies
setup, it's just a matter of writing/copying the data into the
OutputStream.

Any help/guidance would be appreciated.

Thank you,

Dean Ericson

Dean Ericson

MIT Lincoln Laboratory



_______________________________________________
netcdf-java mailing list
netcdf-java@xxxxxxxxxxxxxxxx
For list information or to unsubscribe, visit:
http://www.unidata.ucar.edu/mailing_lists/


_______________________________________________
netcdf-java mailing list
netcdf-java@xxxxxxxxxxxxxxxx
For list information or to unsubscribe, visit:
http://www.unidata.ucar.edu/mailing_lists/




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