blob: 05fc7d0422acc8170129c15c9c6c29b5f00721a5 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
<?php
/**
* Description of FileByte
*
* @author Sander
*/
class FileByte extends FileObject {
private $data;
/**
* Make a short to be stored in a file
* @param short $n
*/
public function __construct($n = 0){
parent::__construct(1);
$this->set($n);
}
public function get(){
return $this->data;
}
public function set($value){
$this->data = intval($value) & 0xFF;
}
public function serialize() {
return $this->byteToString($this->data);
}
public function unserialize($data) {
__construct($this->toInt($data));
}
public function __toString(){
return "FileByte: {".$this->byteAsString($this->data)."}";
}
}
?>
|