Commit e6cbce07 authored by imgqb's avatar imgqb

change the return of readUnicodeString

parent f2250837
...@@ -41,10 +41,11 @@ module.exports = class File ...@@ -41,10 +41,11 @@ module.exports = class File
readString: (length) -> String.fromCharCode.apply(null, @read(length)).replace /\u0000/g, "" readString: (length) -> String.fromCharCode.apply(null, @read(length)).replace /\u0000/g, ""
readUnicodeString: (length = null) -> readUnicodeString: (length = null) ->
length or= @readInt() length or= @readInt()
# new Buffer(@read(length * 2))
@read(length * 2) @read(length * 2)
.map((c) -> Util.getUnicodeCharacter(c)) # .map((c) -> Util.getUnicodeCharacter(c))
.join('') # .join('')
.replace(/\u0000/g, '') # .replace(/\u0000/g, '')
readByte: -> @read(1)[0] readByte: -> @read(1)[0]
readBoolean: -> @readByte() isnt 0 readBoolean: -> @readByte() isnt 0
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment