8.4.3 Retrieving binary resources

While it's not recommended to embed large binary files in the application, it still may be useful to embed binary data. The binary representation of an embedded resource can be accessed using the static method getBytes of haxe.Resource:

class Main {
  static function main() {
    var bytes = haxe.Resource.getBytes("welcome");
    trace(bytes.getString(0, bytes.length));
  }
}

The return type of getBytes method is haxe.io.Bytes, which is an object providing access to individual bytes of the data.