Skip to content

Commit c6dc17e

Browse files
committed
Fixed cocos2d#1643 rename getFileData of cc.FileUtils to getByteArrayFromFile
1 parent 8da5d30 commit c6dc17e

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

cocos2d/platform/CCFileUtils.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,14 @@ cc.FileUtils = cc.Class.extend({
133133
this._searchResolutionsOrderArray.push("");
134134
},
135135
/**
136-
* Get resource file data
136+
* Get Byte Array from file
137137
* @function
138138
* @param {String} fileName The resource file name which contain the path
139139
* @param {String} mode mode The read mode of the file
140140
* @param {Number} size If get the file data succeed the it will be the data size,or it will be 0
141141
* @warning If you get the file data succeed,you must delete it after used.
142142
*/
143-
getFileData:function (fileName, mode, size) {
143+
getByteArrayFromFile:function (fileName, mode, size) {
144144
if (this._fileDataCache.hasOwnProperty(fileName))
145145
return this._fileDataCache[fileName];
146146

@@ -249,10 +249,10 @@ cc.FileUtils = cc.Class.extend({
249249
},
250250

251251
//////////////////////////////////////////////////////////////////////////
252-
// Notification support when getFileData from invalid file path.
252+
// Notification support when getByteArrayFromFile from invalid file path.
253253
//////////////////////////////////////////////////////////////////////////
254254
/**
255-
* Notification support when getFileData from invalid file path.
255+
* Notification support when getByteArrayFromFile from invalid file path.
256256
* @function
257257
* @type {Boolean}
258258
*/
@@ -444,7 +444,7 @@ cc.FileUtils = cc.Class.extend({
444444
* @function
445445
* @param {String} resourcePath The absolute resource path
446446
* @warning Don't call this function in android and iOS, it has not effect.<br/>
447-
* In android, if you want to read file other than apk, you shoud use invoke getFileData(), and pass the<br/>
447+
* In android, if you want to read file other than apk, you shoud use invoke getByteArrayFromFile(), and pass the<br/>
448448
* absolute path.
449449
* @deprecated
450450
*/

extensions/CCBReader/CCBReader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ cc.BuilderReader = cc.Class.extend({
221221
}
222222

223223
var path = cc.FileUtils.getInstance().fullPathFromRelativePath(ccbFileName);
224-
var data = cc.FileUtils.getInstance().getFileData(path);
224+
var data = cc.FileUtils.getInstance().getByteArrayFromFile(path);
225225

226226
return this.readNodeGraphFromData(data, owner, parentSize, animationManager);
227227
},

extensions/CCBReader/CCNodeLoader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ cc.NodeLoader = cc.Class.extend({
715715
var myCCBReader = new cc.BuilderReader(ccbReader);
716716

717717
var size ;
718-
var bytes = cc.FileUtils.getInstance().getFileData(path,"rb", size);
718+
var bytes = cc.FileUtils.getInstance().getByteArrayFromFile(path,"rb", size);
719719

720720
myCCBReader.initWithData(bytes,ccbReader.getOwner());
721721
myCCBReader.getAnimationManager().setRootContainerSize(parent.getContentSize());

0 commit comments

Comments
 (0)