ByteArray.hx 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package flash.utils;
  2. extern class ByteArray implements IDataOutput2 implements IDataInput2 implements ArrayAccess<Int> {
  3. var bytesAvailable(default,never) : UInt;
  4. var endian : Endian;
  5. var length : UInt;
  6. var objectEncoding : UInt;
  7. var position : UInt;
  8. @:require(flash11_4) var shareable : 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. @:require(flash10) function inflate() : Void;
  16. function readBoolean() : Bool;
  17. function readByte() : Int;
  18. function readBytes(bytes : ByteArray, offset : UInt = 0, length : UInt = 0) : Void;
  19. function readDouble() : Float;
  20. function readFloat() : Float;
  21. function readInt() : Int;
  22. function readMultiByte(length : UInt, charSet : String) : String;
  23. function readObject() : Dynamic;
  24. function readShort() : Int;
  25. function readUTF() : String;
  26. function readUTFBytes(length : UInt) : String;
  27. function readUnsignedByte() : UInt;
  28. function readUnsignedInt() : UInt;
  29. function readUnsignedShort() : UInt;
  30. function toString() : String;
  31. function uncompress(?algorithm : CompressionAlgorithm) : Void;
  32. function writeBoolean(value : Bool) : Void;
  33. function writeByte(value : Int) : Void;
  34. function writeBytes(bytes : ByteArray, offset : UInt = 0, length : UInt = 0) : Void;
  35. function writeDouble(value : Float) : Void;
  36. function writeFloat(value : Float) : Void;
  37. function writeInt(value : Int) : Void;
  38. function writeMultiByte(value : String, charSet : String) : Void;
  39. function writeObject(object : Dynamic) : Void;
  40. function writeShort(value : Int) : Void;
  41. function writeUTF(value : String) : Void;
  42. function writeUTFBytes(value : String) : Void;
  43. function writeUnsignedInt(value : UInt) : Void;
  44. static var defaultObjectEncoding : UInt;
  45. }