src/formats/geotiff/GeoTiffUtil.js
function (geoTiffData, byteOffset, numOfBytes, isLittleEndian, isSigned) {
                if (numOfBytes <= 0) {
                    throw new ArgumentError(
                        Logger.logMessage(Logger.LEVEL_SEVERE, "GeoTiffReader", "getBytes", "noBytesRequested"));
                } else if (numOfBytes <= 1) {
                    if (isSigned) {
                        return geoTiffData.getInt8(byteOffset, isLittleEndian);
                    }
                    else {
                        return geoTiffData.getUint8(byteOffset, isLittleEndian);
                    }
                } else if (numOfBytes <= 2) {
                    if (isSigned) {
                        return geoTiffData.getInt16(byteOffset, isLittleEndian);
                    }
                    else {
                        return geoTiffData.getUint16(byteOffset, isLittleEndian);
                    }
                } else if (numOfBytes <= 3) {
                    if (isSigned) {
                        return geoTiffData.getInt32(byteOffset, isLittleEndian) >>> 8;
                    }
                    else {
                        return geoTiffData.getUint32(byteOffset, isLittleEndian) >>> 8;
                    }
                } else if (numOfBytes <= 4) {
                    if (isSigned) {
                        return geoTiffData.getInt32(byteOffset, isLittleEndian);
                    }
                    else {
                        return geoTiffData.getUint32(byteOffset, isLittleEndian);
                    }
                } else if (numOfBytes <= 8) {
                    return geoTiffData.getFloat64(byteOffset, isLittleEndian);
                } else {
                    throw new ArgumentError(
                        Logger.logMessage(Logger.LEVEL_SEVERE, "GeoTiffReader", "getBytes", "tooManyBytesRequested"));
                }
            }
function (geoTiffData, byteOffset, numOfBytes, isLittleEndian, isSigned) {
                if (numOfBytes <= 0) {
                    throw new ArgumentError(
                        Logger.logMessage(Logger.LEVEL_SEVERE, "GeoTiffReader", "getBytes", "noBytesRequested"));
                } else if (numOfBytes <= 1) {
                    if (isSigned) {
                        return geoTiffData.getInt8(byteOffset, isLittleEndian);
                    }
                    else {
                        return geoTiffData.getUint8(byteOffset, isLittleEndian);
                    }
                } else if (numOfBytes <= 2) {
                    if (isSigned) {
                        return geoTiffData.getInt16(byteOffset, isLittleEndian);
                    }
                    else {
                        return geoTiffData.getUint16(byteOffset, isLittleEndian);
                    }
                } else if (numOfBytes <= 3) {
                    if (isSigned) {
                        return geoTiffData.getInt32(byteOffset, isLittleEndian) >>> 8;
                    }
                    else {
                        return geoTiffData.getUint32(byteOffset, isLittleEndian) >>> 8;
                    }
                } else if (numOfBytes <= 4) {
                    if (isSigned) {
                        return geoTiffData.getInt32(byteOffset, isLittleEndian);
                    }
                    else {
                        return geoTiffData.getUint32(byteOffset, isLittleEndian);
                    }
                } else if (numOfBytes <= 8) {
                    return geoTiffData.getFloat64(byteOffset, isLittleEndian);
                } else {
                    throw new ArgumentError(
                        Logger.logMessage(Logger.LEVEL_SEVERE, "GeoTiffReader", "getBytes", "tooManyBytesRequested"));
                }
            }
function ( geoTiffData , byteOffset , numOfBytes , isLittleEndian , isSigned ) { if ( numOfBytes <= 0 ) { throw new ArgumentError ( Logger . logMessage ( Logger . LEVEL_SEVERE , "GeoTiffReader" , "getBytes" , "noBytesRequested" ) ) ; } else if ( numOfBytes <= 1 ) { if ( isSigned ) { return geoTiffData . getInt8 ( byteOffset , isLittleEndian ) ; } else { return geoTiffData . getUint8 ( byteOffset , isLittleEndian ) ; } } else if ( numOfBytes <= 2 ) { if ( isSigned ) { return geoTiffData . getInt16 ( byteOffset , isLittleEndian ) ; } else { return geoTiffData . getUint16 ( byteOffset , isLittleEndian ) ; } } else if ( numOfBytes <= 3 ) { if ( isSigned ) { return geoTiffData . getInt32 ( byteOffset , isLittleEndian ) >>> 8 ; } else { return geoTiffData . getUint32 ( byteOffset , isLittleEndian ) >>> 8 ; } } else if ( numOfBytes <= 4 ) { if ( isSigned ) { return geoTiffData . getInt32 ( byteOffset , isLittleEndian ) ; } else { return geoTiffData . getUint32 ( byteOffset , isLittleEndian ) ; } } else if ( numOfBytes <= 8 ) { return geoTiffData . getFloat64 ( byteOffset , isLittleEndian ) ; } else { throw new ArgumentError ( Logger . logMessage ( Logger . LEVEL_SEVERE , "GeoTiffReader" , "getBytes" , "tooManyBytesRequested" ) ) ; } }
Get bytes from an arraybuffer depending on the size. Internal use only.
Get bytes from an arraybuffer depending on the size . Internal use only .