I have read the following posts on reading in SRTM HGT elevations- How do you convert SRTM HGT elevations from WGS84 into meters above sea level? and How to extract elevation from .HGT file? I am currently undertaking this exercise using Java on an Intel Platform. My machine "endianness" is actually little endian and so when I write this file out differently(south to north as a meteorological application requires it that way) are there any additional steps to be carried out ? My initial code checked on the endianness of the system and then read in the .hgt file appropriately. When I actually ran the weather simulation I got strange elevation values.
fc = new FileInputStream(file).getChannel(); ByteBuffer bb = ByteBuffer.allocateDirect((int) fc.size()); while (bb.hasRemaining()) fc.read(bb); bb.flip(); sb = bb.order(ByteOrder.BIG_ENDIAN).asShortBuffer();