Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const getShort = function(position, bigEndian = true) {
- const int1 = this[value];
- const int2 = this[value+1];
- let result = (int1 << 8) | (int2 & 0xFF);
- if(!bigEndian) {
- let buffer = new ArrayBuffer(16);
- let view = new DataView(buffer);
- view.setInt16(1,result);
- result = view.getInt16(1, true) ;
- }
- return(result);
- }
Add Comment
Please, Sign In to add comment