Java Unsigned Number Create unsignedByteToLong(final byte b)

Here you can find the source of unsignedByteToLong(final byte b)

Description

unsigned Byte To Long

License

Open Source License

Parameter

Parameter Description
b a parameter

Declaration

public static long unsignedByteToLong(final byte b) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2011 www.isandlatech.com (www.isandlatech.com)
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors://ww  w  . j ava  2 s .c  om
 *    ogattaz (isandlaTech) - initial API and implementation
 *******************************************************************************/

public class Main {
    /**
     * @param b
     * @return
     */
    public static long unsignedByteToLong(final byte b) {
        return (b & 128) + (b & 127);
    }
}

Related

  1. unsignedByteToInt(byte b)
  2. unsignedByteToInt(byte b)
  3. unsignedByteToInt(byte in)
  4. unsignedByteToInt(final byte b)
  5. unsignedByteToIntArray(byte[] bytes)
  6. unsignedByteToString(int i)
  7. unsignedByteValue(byte[] data, int offset)
  8. unsignedByteValue(final byte input)
  9. unsignedChar(char c)