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.
On Feb 2, 2004, at 7:26 PM, Rob Hackett wrote: ...
I would like to be able to write this field to a local file to allow it to be archived seperately from ADDE database, along with any changes that a user may have made to the field. I have chosen to do this using BinaryWriterand reading the field back using BinaryReader, as they seem to offer a simple, efficient means to do this.
...
Initially this gets me exactly what I want, the field is written to file, and when read back in is exactly as it was before. The problem is I can onlyread it once. If I attempt to read the file again (or any other file containing this field structure) I get the following stack trace:
...
I can't reproduce this error using a more simple gridded FlatField, and theerror also occurs if I have previously used a field of this form when extracted directly from AddePointDataReader, without having made anyprevious reference to BinaryWriter or BinaryReader. It seems to be specificto the data field structure that I'm trying to store. Could anyone explain to me what might be happening? Or alternativelysuggest another, equally simple way of storing a field of this structure toa local file.
I'd bet you've found a bug in the BinaryReader code. If you can send me the file which causes the error, I'll try to fix the bug.
visad
archives: