Created
May 11, 2013 09:29
-
-
Save NuckChorris/5559433 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var ioService = Components.classes['@mozilla.org/network/io-service;1'].getService(Components.interfaces.nsIIOService); | |
| var scriptableStream = Components.classes['@mozilla.org/scriptableinputstream;1'].getService(Components.interfaces.nsIScriptableInputStream); | |
| var input = ioService.newChannel("path/to/file", null, null).open(); | |
| scriptableStream.init(input); | |
| var output = scriptableStream.read(input.available()); | |
| scriptableStream.close(); | |
| input.close(); | |
| // Do things with output |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment