diff options
author | tcit <tcit@tcit.fr> | 2014-07-24 15:49:36 +0200 |
---|---|---|
committer | tcit <tcit@tcit.fr> | 2014-07-24 15:49:36 +0200 |
commit | 4188f38ad56d7ba2ea46e94403f305243514f80c (patch) | |
tree | f357ddbd0d846ebae0ecf5d2ab00d6b7dd6eb8d5 /inc/3rdparty/libraries/send2kindle/MOBIClass/FileByte.php | |
parent | 2b58426b2d4a7f1585d5d7667c0a4fbea4cd29dd (diff) | |
download | wallabag-4188f38ad56d7ba2ea46e94403f305243514f80c.tar.gz wallabag-4188f38ad56d7ba2ea46e94403f305243514f80c.tar.zst wallabag-4188f38ad56d7ba2ea46e94403f305243514f80c.zip |
add pdf and mobi libraries
Diffstat (limited to 'inc/3rdparty/libraries/send2kindle/MOBIClass/FileByte.php')
-rw-r--r-- | inc/3rdparty/libraries/send2kindle/MOBIClass/FileByte.php | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/inc/3rdparty/libraries/send2kindle/MOBIClass/FileByte.php b/inc/3rdparty/libraries/send2kindle/MOBIClass/FileByte.php new file mode 100644 index 00000000..05fc7d04 --- /dev/null +++ b/inc/3rdparty/libraries/send2kindle/MOBIClass/FileByte.php | |||
@@ -0,0 +1,41 @@ | |||
1 | <?php | ||
2 | |||
3 | /** | ||
4 | * Description of FileByte | ||
5 | * | ||
6 | * @author Sander | ||
7 | */ | ||
8 | class FileByte extends FileObject { | ||
9 | private $data; | ||
10 | |||
11 | /** | ||
12 | * Make a short to be stored in a file | ||
13 | * @param short $n | ||
14 | */ | ||
15 | public function __construct($n = 0){ | ||
16 | parent::__construct(1); | ||
17 | $this->set($n); | ||
18 | } | ||
19 | |||
20 | public function get(){ | ||
21 | return $this->data; | ||
22 | } | ||
23 | |||
24 | public function set($value){ | ||
25 | $this->data = intval($value) & 0xFF; | ||
26 | } | ||
27 | |||
28 | public function serialize() { | ||
29 | return $this->byteToString($this->data); | ||
30 | } | ||
31 | |||
32 | public function unserialize($data) { | ||
33 | __construct($this->toInt($data)); | ||
34 | } | ||
35 | |||
36 | |||
37 | public function __toString(){ | ||
38 | return "FileByte: {".$this->byteAsString($this->data)."}"; | ||
39 | } | ||
40 | } | ||
41 | ?> | ||