Skip to content

Instantly share code, notes, and snippets.

import java.util.List;
import java.io.FileWriter;
import java.io.BufferedWriter;
import java.nio.ByteBuffer;
import javax.smartcardio.*;
class ProxNRollReader {
byte[] GET_UID = {(byte)0xFF, (byte)0xCA, (byte)0x00,
(byte)0x00, (byte)0x00};
<?php
function saveCacheFile($file, $contents)
{
$serialized = serialize($contents);
$len = strlen($serialized);
$cachefile_fp = @fopen($file, 'xb'); // x is the O_CREAT|O_EXCL mode
if ($cachefile_fp !== false) { // create file
if (fwrite($cachefile_fp, $serialized, $len) < $len) {
return PEAR::raiseError("Could not write $file.");