This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Hi Steve: Unidata Support wrote:
Im not sure what you are diffing here? The 2 look identical. Is the above code incorrect?To: address@hidden From: "Stephen P. Cerruti" <address@hidden> Subject: Bug? in ucar.unidata.io.RandomAccessFile NetCDF for JavaOrganization: Keywords: 200501141454.j0EEsxv2011929I am using ucar.unidata.io.RandomAccessFile in another application to speed processing of some corrupted tiff files.I discovered that when writing out large chunks of data when the buffer was unmodified the file pointer was not in the correct position.580c580,581 < bufferStart = dataEnd = dataSize = 0; --- > bufferStart = dataEnd = dataSize = 0; > file.seek(filePosition); // JC added Oct 21, 2004 582,583d582 < file.seek(filePosition); // JC added Oct 21, 2004 <
Also, and I don't know if this was intentional, but ReadUnsignedShort is not swapping bytes.737,740c736 < if (bigEndian) < return (short)((ch1 << 8) + (ch2 << 0)); < else < return (short)((ch2 << 8) + (ch1 << 0)); --- > return (ch1 << 8) + (ch2 << 0);
thanks, that was inadvertant; ill add in your fix
Thanks for the class.
youre welcome, thanks for your feedback