How to use the fromBytesLE function from long
Find comprehensive JavaScript long.fromBytesLE code examples handpicked from public code repositorys.
GitHub: mmmika/gridgain
182 183 184 185 186 187 188 189 190
} readLong() { const size = BinaryUtils.getSize(BinaryUtils.TYPE_CODE.LONG) this._ensureSize(size); const value = Long.fromBytesLE([...this._buffer.slice(this._position, this._position + size)]); this._position += size; return value; }
50
0
1
9 10 11 12 13 14 15 16 17 18
*/ function decode (genericDecoder, buf, flag = 0) { let result = null if (flag === 1) { result = { value: Long.fromBytesLE(buf.slice(0)).toNumber(), length: 8 } } else { result = {
18
1
2
192 193 194 195 196 197 198 199 200
} readLong(): Long { const size = BinaryUtils.getSize(BinaryUtils.TYPE_CODE.LONG); this._ensureSize(size); const value: Long = Long.fromBytesLE([...this._buffer.slice(this._position, this._position + size)]); this._position += size; return value; }
7
3
21
GitHub: knmkr/tabix-js
213 214 215 216 217 218 219
return data } parsePseudoBin(bytes, offset) { // const one = Long.fromBytesLE(bytes.slice(offset + 4, offset + 12), true) // const two = Long.fromBytesLE(bytes.slice(offset + 12, offset + 20), true)
4
0
1
+ 3 other calls in file
GitHub: knmkr/bgzf-filehandle
9 10 11 12 13 14 15 16 17 18
else if (path) this.filehandle = new LocalFile(path) else throw new TypeError('either filehandle or path must be defined') } _readLongWithOverflow(buf, offset = 0, unsigned = true) { const long = Long.fromBytesLE(buf.slice(offset, offset + 8), unsigned) if ( long.greaterThan(Number.MAX_SAFE_INTEGER) || long.lessThan(Number.MIN_SAFE_INTEGER) )
3
0
1
long.default is the most popular function in long (905 examples)