|
@@ -200,7 +200,7 @@ class Bytes {
|
|
return b.readFloat();
|
|
return b.readFloat();
|
|
#end
|
|
#end
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
public function setDouble( pos : Int, v : Float ) : Void {
|
|
public function setDouble( pos : Int, v : Float ) : Void {
|
|
#if neko
|
|
#if neko
|
|
untyped $sblit(b, pos, Output._double_bytes(v,false), 0, 8);
|
|
untyped $sblit(b, pos, Output._double_bytes(v,false), 0, 8);
|
|
@@ -223,7 +223,7 @@ class Bytes {
|
|
#end
|
|
#end
|
|
}
|
|
}
|
|
|
|
|
|
- public function readString( pos : Int, len : Int ) : String {
|
|
|
|
|
|
+ public function getString( pos : Int, len : Int ) : String {
|
|
#if !neko
|
|
#if !neko
|
|
if( pos < 0 || len < 0 || pos + len > length ) throw Error.OutsideBounds;
|
|
if( pos < 0 || len < 0 || pos + len > length ) throw Error.OutsideBounds;
|
|
#end
|
|
#end
|
|
@@ -274,6 +274,13 @@ class Bytes {
|
|
#end
|
|
#end
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @:deprecated("readString is deprecated, use getString instead")
|
|
|
|
+ @:noCompletion
|
|
|
|
+ // TODO: add inline if/when issue #2837 is resolved
|
|
|
|
+ public /*inline*/ function readString(pos:Int, len:Int):String {
|
|
|
|
+ return getString(pos, len);
|
|
|
|
+ }
|
|
|
|
+
|
|
public function toString() : String {
|
|
public function toString() : String {
|
|
#if neko
|
|
#if neko
|
|
return new String(untyped __dollar__ssub(b,0,length));
|
|
return new String(untyped __dollar__ssub(b,0,length));
|