Java Bit Unpack unpackByte(String bits)

Here you can find the source of unpackByte(String bits)

Description

Unpack a binary string ("10011...") into a byte

License

Open Source License

Parameter

Parameter Description
bits a parameter

Return

a byte value with the same bit pattern defined by bits

Declaration

public static byte unpackByte(String bits) 

Method Source Code

//package com.java2s;

public class Main {
    /**/*from w  w w .j ava  2  s.com*/
     * Unpack a binary string ("10011...") into a byte
     * 
     * @param bits
     * @return a byte value with the same bit pattern defined by bits
     */
    public static byte unpackByte(String bits) {
        return Byte.parseByte(bits, 2);
    }
}

Related

  1. unpackBytes(String src)
  2. unpackUnsignedByte(byte b)