Minor compile fix
This commit is contained in:
@@ -356,7 +356,7 @@ class Bytes {
|
|||||||
setInt32(pos + 4, v.high);
|
setInt32(pos + 4, v.high);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getString( pos : Int, len : Int ) : String {
|
public function getString( pos : Int, len : Int, ?encoding : Dynamic ) : 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
|
||||||
@@ -417,6 +417,9 @@ class Bytes {
|
|||||||
return getString(pos, len);
|
return getString(pos, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Returns string representation of the bytes as UTF8
|
||||||
|
**/
|
||||||
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));
|
||||||
@@ -479,8 +482,11 @@ class Bytes {
|
|||||||
#end
|
#end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Returns bytes representation of the given String, using specific encoding (UTF-8 by default)
|
||||||
|
**/
|
||||||
@:pure
|
@:pure
|
||||||
public static function ofString( s : String ) : Bytes {
|
public static function ofString( s : String, ?encoding : Dynamic ) : Bytes {
|
||||||
#if neko
|
#if neko
|
||||||
return new Bytes(s.length,untyped __dollar__ssub(s.__s,0,s.length));
|
return new Bytes(s.length,untyped __dollar__ssub(s.__s,0,s.length));
|
||||||
#elseif flash
|
#elseif flash
|
||||||
|
|||||||
Reference in New Issue
Block a user