From 7a7f1be950f959e208de799483c89291ba7a0119 Mon Sep 17 00:00:00 2001 From: YuutaW <17158086+trumeet@users.noreply.github.com> Date: Fri, 19 Apr 2019 10:47:50 -0700 Subject: docs: add docs about the extended APIs Signed-off-by: YuutaW <17158086+Trumeet@users.noreply.github.com> --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index f918f2a..d2c52b7 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,31 @@ if (theFxxkFile.isFile()) { } ``` +## Extend usages + +Some APIs don't work with `SafFile`. In these cases, you should cast the returned `File` to `SafFile` and use extended APIs. + +```java +SafFile theMagic = OhMySAF.ohMyUri(context, uri); +``` + +### Get Android Uri + +It returns the Android `Uri` and you can do ANYTHING you want with it. + +```java +final Uri uri = theMagic.getAndroidUri(); +``` + +### Open input / output stream + +The Java `FileInputStream` and `FileOutputStream` does not work with the file directly. Talk is cheap, let's show you the code: + +```java +final OutputStream stream = theMagic.openOutputStream(this, "w"); +stream.close(); +``` + # Licenses Apache 2.0 \ No newline at end of file -- cgit v1.2.3