byte To Dword - Java java.lang

Java examples for java.lang:String UTF

Description

byte To Dword

Demo Code


//package com.java2s;

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);
    }/*ww w .j a  va2 s.  c o  m*/

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

Related Tutorials