ByteBuffer.hx 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. package java.nio;
  2. import haxe.Int64;
  3. import haxe.io.BytesData;
  4. import java.StdTypes;
  5. extern class ByteBuffer extends Buffer
  6. {
  7. static function allocate(capacity:Int):ByteBuffer;
  8. static function allocateDirect(capacity:Int):ByteBuffer;
  9. @:overload(function(arr:BytesData, offset:Int, length:Int):ByteBuffer {})
  10. static function wrap(arr:BytesData):ByteBuffer;
  11. function array():BytesData;
  12. function arrayOffset():Int;
  13. function compact():ByteBuffer;
  14. function compareTo(obj:Dynamic):Int;
  15. function duplicate():ByteBuffer;
  16. @:overload(function (dst:BytesData, offset:Int, length:Int):ByteBuffer {})
  17. @:overload(function (dst:BytesData):ByteBuffer {})
  18. @:overload(function (idx:Int):Int8 {})
  19. function get():Int8;
  20. @:overload(function (index:Int):Char16 {})
  21. function getChar():Char16;
  22. @:overload(function (index:Int):Float {})
  23. function getDouble():Float;
  24. @:overload(function (index:Int):Single {})
  25. function getFloat():Single;
  26. @:overload(function (index:Int):Int {})
  27. function getInt():Int;
  28. @:overload(function (index:Int):Int64 {})
  29. function getLong():Int64;
  30. @:overload(function (index:Int):Int16 {})
  31. function getShort():Int16;
  32. function hasArray():Bool;
  33. function isDirect():Bool;
  34. @:overload(function (index:ByteOrder):ByteBuffer {})
  35. function order():ByteOrder;
  36. @:overload(function (index:Int, b:Int8):ByteBuffer {})
  37. @:overload(function (src:ByteBuffer):ByteBuffer {})
  38. @:overload(function (src:BytesData, offset:Int, length:Int):ByteBuffer {})
  39. @:overload(function (src:BytesData):ByteBuffer {})
  40. function put(b:Int8):ByteBuffer;
  41. @:overload(function (index:Int, value:Char16):ByteBuffer {})
  42. function putChar(value:Char16):ByteBuffer;
  43. @:overload(function (index:Int, value:Float):ByteBuffer {})
  44. function putDouble(value:Float):ByteBuffer;
  45. @:overload(function (index:Int, value:Single):ByteBuffer {})
  46. function putFloat(value:Single):ByteBuffer;
  47. @:overload(function (index:Int, value:Int):ByteBuffer {})
  48. function putInt(value:Int):ByteBuffer;
  49. @:overload(function (index:Int, value:Int64):ByteBuffer {})
  50. function putLong(value:Int64):ByteBuffer;
  51. @:overload(function (index:Int, value:Int16):ByteBuffer {})
  52. function putShort(value:Int16):ByteBuffer;
  53. }