Java Byte Array to DWord byteToDword(byte btValue[])

Here you can find the source of byteToDword(byte btValue[])

Description

byte To Dword

License

Apache License

Declaration

public static double byteToDword(byte btValue[]) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static double byteToDword(byte btValue[]) {
        return fixSignedByte(btValue[0]) + (fixSignedByte(btValue[1]) << 8) + (fixSignedByte(btValue[2]) << 16)
                + (fixSignedByte(btValue[3]) << 24);
    }/* w  w w  . jav a2  s  .co  m*/

    public static short fixSignedByte(byte btValue) {
        if (btValue < 0)
            return (short) (btValue + 256);
        return btValue;
    }
}