I need to read a file in chunks from local file system.I used text-
streams which always returns empty string.I used byte-stream which
throws error shown below.Can't make sense what is the issue.I have
pasted sample code here
http://pastebin.com/siGh9Vbm
Error: Error reading from stream: [Exception... "'JavaScript component
does not
have a method named: "available"' when calling method:
[nsIInputStream::availabl
e]" nsresult: "0x80570030
(NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED)" locat
ion: "JS frame :: resource://jid0-gsou2rxu0ucznub4ermuc69s5zi-api-utils-lib/secu
rable-module.js -> resource://jid0-gsou2rxu0ucznub4ermuc69s5zi-api-utils-lib/byt
e-streams.js :: ByteReader_read :: line 66" data: no]
[Exception... "'Error: The stream is closed and cannot be used.' when
calling me
thod: [nsIInputStream::close]" nsresult: "0x8057001c
(NS_ERROR_XPC_JS_THREW_JS_
OBJECT)" location: "JS frame :: resource://jid0-gsou2rxu0ucznub4ermuc69s5zi-api
-utils-lib/securable-module.js -> resource://jid0-gsou2rxu0ucznub4ermuc69s5zi-ap
i-utils-lib/byte-streams.js :: StreamManager_unload :: line 130"
data: no] (und
efined:130)