Package com.topjohnwu.superuser.io
Class SuFileOutputStream
java.lang.Object
com.topjohnwu.superuser.io.SuFileOutputStream
Open
OutputStream
s that read files with root access.
Directly creating instances of this class is deprecated, please use the static helper methods to open new OutputStreams.
-
Method Summary
Modifier and TypeMethodDescriptionstatic OutputStream
SuFileOutputStream.open(file, false)
static OutputStream
Open anOutputStream
with root access.static OutputStream
SuFileOutputStream.open(new File(path), false)
static OutputStream
SuFileOutputStream.open(new File(path), append)
-
Method Details
-
open
SuFileOutputStream.open(new File(path), false)
- Throws:
FileNotFoundException
-
open
@NonNull public static OutputStream open(@NonNull String path, boolean append) throws FileNotFoundException SuFileOutputStream.open(new File(path), append)
- Throws:
FileNotFoundException
-
open
SuFileOutputStream.open(file, false)
- Throws:
FileNotFoundException
-
open
@NonNull public static OutputStream open(@NonNull File file, boolean append) throws FileNotFoundException Open anOutputStream
with root access.Unless
file
is anSuFile
, this method will always try to directly open aFileOutputStream
, and fallback to using root access when it fails.- Throws:
FileNotFoundException
- See Also:
-