dhaarbrink
June 11th, 2008, 10:01 AM
hi everybody,
i'm building a static function which sole purpose is to read an entire file and return its contents. for the i use the File and FileStream objects.
with a 'normal' file this works fine, but my sample-file contains a lot of null-bytes which seems to break the readUTFBytes() and readMultiByte() functions.. everything is allright until a null-byte is encountered, the functions just returns normally, no errors, but all i get is the contents till the null-byte, no more.
does anybody have a clue as to how this happens, but more importantly how i can work around it? and if it fails on null-bytes what else should i expect?
i have also tried using an URLLoader, with this i get the full contents without a problem, but afaik it only works asynchronously? is there a way to make it work synchronously?
thanks in advance.
i'm building a static function which sole purpose is to read an entire file and return its contents. for the i use the File and FileStream objects.
with a 'normal' file this works fine, but my sample-file contains a lot of null-bytes which seems to break the readUTFBytes() and readMultiByte() functions.. everything is allright until a null-byte is encountered, the functions just returns normally, no errors, but all i get is the contents till the null-byte, no more.
does anybody have a clue as to how this happens, but more importantly how i can work around it? and if it fails on null-bytes what else should i expect?
i have also tried using an URLLoader, with this i get the full contents without a problem, but afaik it only works asynchronously? is there a way to make it work synchronously?
thanks in advance.