Example usage for org.apache.commons.codec.binary BinaryCodec decode

List of usage examples for org.apache.commons.codec.binary BinaryCodec decode

Introduction

In this page you can find the example usage for org.apache.commons.codec.binary BinaryCodec decode.

Prototype

public byte[] decode(byte[] ascii) 

Source Link

Document

Decodes a byte array where each byte represents an ascii '0' or '1'.

Usage

From source file:Main.java

public static byte[] bitsToBytes(String bits) {
    BinaryCodec binaryCodec = new BinaryCodec();
    return binaryCodec.decode(bits.getBytes());
}