-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.php
More file actions
53 lines (51 loc) · 1.05 KB
/
index.php
File metadata and controls
53 lines (51 loc) · 1.05 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/**
*@Created 2010-11-1
*@author sunli
*@copyright dev@ifeng.com
*@version $Id$
*/
require 'class/BigEndianBytesBuffer.php';
class request {
public $width = 5;
public $height = 6;
private $buffer;
public function __construct() {
$this->buffer = new BigEndianBytesBuffer ( '' );
}
public function tobytes() {
$this->buffer->clear ();
$this->buffer->writeInt ( $this->width );
$this->buffer->writeInt ( $this->height );
return $this->buffer;
}
/**
* Enter description here...
*
* @param BigEndianBuffer $buffer
*/
public function frombytes($buffer) {
$this->width = $buffer->readInt ();
$this->height = $buffer->readInt ();
}
}
/**
* get file buffer
*
* @return BigEndianBuffer
*/
function getfile(){
return new BigEndianBytesBuffer(file_get_contents('db'));
}
$buffer=getfile();
echo $buffer->readChar();
echo "\r\n";
echo $buffer->readShort();
echo "\r\n";
echo $buffer->readInt();
echo "\r\n";
echo $buffer->readLong();
echo "\r\n";
echo $buffer->readBytes(4);
echo "\r\n";
?>