ByteArray.hx 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. package flash.utils;
  2. extern class ByteArray implements IDataOutput2 implements IDataInput2 implements ArrayAccess<Int> {
  3. @:flash.property var bytesAvailable(get,never) : UInt;
  4. @:flash.property var endian(get,set) : Endian;
  5. @:flash.property var length(get,set) : UInt;
  6. @:flash.property var objectEncoding(get,set) : UInt;
  7. @:flash.property var position(get,set) : UInt;
  8. @:flash.property @:require(flash11_4) var shareable(get,set) : Bool;
  9. function new() : Void;
  10. @:require(flash11_4) function atomicCompareAndSwapIntAt(byteIndex : Int, expectedValue : Int, newValue : Int) : Int;
  11. @:require(flash11_4) function atomicCompareAndSwapLength(expectedLength : Int, newLength : Int) : Int;
  12. @:require(flash10) function clear() : Void;
  13. function compress(?algorithm : CompressionAlgorithm) : Void;
  14. @:require(flash10) function deflate() : Void;
  15. private function get_bytesAvailable() : UInt;
  16. private function get_endian() : Endian;
  17. private function get_length() : UInt;
  18. private function get_objectEncoding() : UInt;
  19. private function get_position() : UInt;
  20. private function get_shareable() : Bool;
  21. @:require(flash10) function inflate() : Void;
  22. function readBoolean() : Bool;
  23. function readByte() : Int;
  24. function readBytes(bytes : ByteArray, offset : UInt = 0, length : UInt = 0) : Void;
  25. function readDouble() : Float;
  26. function readFloat() : Float;
  27. function readInt() : Int;
  28. function readMultiByte(length : UInt, charSet : String) : String;
  29. function readObject() : Dynamic;
  30. function readShort() : Int;
  31. function readUTF() : String;
  32. function readUTFBytes(length : UInt) : String;
  33. function readUnsignedByte() : UInt;
  34. function readUnsignedInt() : UInt;
  35. function readUnsignedShort() : UInt;
  36. private function set_endian(value : Endian) : Endian;
  37. private function set_length(value : UInt) : UInt;
  38. private function set_objectEncoding(value : UInt) : UInt;
  39. private function set_position(value : UInt) : UInt;
  40. private function set_shareable(value : Bool) : Bool;
  41. function toString() : String;
  42. function uncompress(?algorithm : CompressionAlgorithm) : Void;
  43. function writeBoolean(value : Bool) : Void;
  44. function writeByte(value : Int) : Void;
  45. function writeBytes(bytes : ByteArray, offset : UInt = 0, length : UInt = 0) : Void;
  46. function writeDouble(value : Float) : Void;
  47. function writeFloat(value : Float) : Void;
  48. function writeInt(value : Int) : Void;
  49. function writeMultiByte(value : String, charSet : String) : Void;
  50. function writeObject(object : Dynamic) : Void;
  51. function writeShort(value : Int) : Void;
  52. function writeUTF(value : String) : Void;
  53. function writeUTFBytes(value : String) : Void;
  54. function writeUnsignedInt(value : UInt) : Void;
  55. @:flash.property static var defaultObjectEncoding(get,set) : UInt;
  56. private static function get_defaultObjectEncoding() : UInt;
  57. private static function set_defaultObjectEncoding(value : UInt) : UInt;
  58. }