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());
}
ffprobe -hide_banner -v error -print_format json -show_format -show_streams
формат вывода может быть и другой$pdo = new PDO($dsn, $user, $pass, $opt);
class oop
{
function __construct($pdo)
{
$this->pdo = $pdo;
}
function anythingForDb($arg)
{
$q = "SELECT * FROM table WHERE field=?";
$test = $this->pdo->prepare($q);
$test->execute([$arg]);
return $test->fetchAll();
}
}
$oop = new oop($pdo);
print_r($oop->anythingForDb('test'));