public function __construct($dataDir) { $fmis = new FileMappedInputStream($dataDir . "/matrix.bin"); $this->leftSize = $fmis->getInt(); $this->rightSize = $fmis->getInt(); $this->matrix = $fmis->getShortArrayInstance($this->leftSize * $this->rightSize); $fmis->close(); }
public function __construct($filePath) { $fmis = new FileMappedInputStream($filePath); $nodeSz = $fmis->getInt(); $tindSz = $fmis->getInt(); $tailSz = $fmis->getInt(); $this->keySetSize = $tindSz; $this->begs = $fmis->getIntArrayInstance($tindSz); $this->base = $fmis->getIntArrayInstance($nodeSz); $this->lens = $fmis->getShortArrayInstance($tindSz); $this->chck = $fmis->getCharArrayInstance($nodeSz); $this->tail = array_values(unpack("S*", $fmis->getString($tailSz))); $fmis->close(); }