String stringBits = "11111111";
byte oneByte = (byte) Integer.parseInt(stringBits , 2);
byte[] byteArray = new byte[1];
byteArray[0] = oneByte;
try (FileOutputStream fos = new FileOutputStream(PATH_OUT)) {
fos.write(byteArray, 0, byteArray.length);
} catch (IOException ex) {
System.out.println(ex.getMessage());
}