Move cycleway=segregated and cycleway=shared to highway=cycleway, rather than road...
[potlatch2.git] / hxasm / Output.as
1 package hxasm {
2         import flash.utils.Endian;
3         import flash.utils.ByteArray;
4
5         public class Output {
6                 public function Output() : void {
7                         this.b = new ByteArray();
8                         this.b.endian = Endian.LITTLE_ENDIAN;
9                 }
10                 protected var b : ByteArray;
11                 public function write(str : String) : void {
12                         this.b.writeUTFBytes(str);
13                 }
14                 public function writeBinary(b : ByteArray) : void {
15                         this.b.writeBytes(b);
16                 }
17                 public function writeChar(c : int) : void {
18                         this.b.writeByte(c);
19                 }
20                 public function writeInt32(i : int) : void {
21                         this.b.writeInt(i);
22                 }
23                 public function writeUInt32(i : int) : void {
24                         this.b.writeUnsignedInt(i);
25                 }
26                 public function writeDouble(f : Number) : void {
27                         this.b.writeDouble(f);
28                 }
29                 public function writeUInt16(x : int) : void {
30                         if(x < 0 || x > 65535) throw "Overflow";
31                         this.writeChar(x & 255);
32                         this.writeChar(x >> 8);
33                 }
34                 public function writeUInt24(x : int) : void {
35                         if(x < 0 || x > 16777215) throw "Overflow";
36                         this.writeChar(x & 255);
37                         this.writeChar((x >> 8) & 255);
38                         this.writeChar(x >> 16);
39                 }
40                 public function writeInt24(x : int) : void {
41                         if(x < -8388608 || x > 8388607) throw "Overflow";
42                         if(x < 0) this.writeUInt24(16777216 + x);
43                         else this.writeUInt24(x);
44                 }
45                 public function writeInt8(c : int) : void {
46                         if(c < -128 || c > 127) throw "Overflow";
47                         this.writeChar(c & 255);
48                 }
49                 public function getBytes() : ByteArray {
50                         return this.b;
51                 }
52         }
53 }