Skip to content

Commit 75f06df

Browse files
committed
Testing the basic post hoc FileProvider interface class
1 parent 90fa271 commit 75f06df

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

AndroidFilePickerLightLibrary/src/main/java/com/maxieds/androidfilepickerlightlibrary/BasicFileProvider.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ public byte[] readFileContentsAsByteArray(final String documentId, int offset, i
843843
* https://developer.android.com/guide/topics/providers/create-document-provider#browsing
844844
*/
845845

846-
class DocumentPointer {
846+
public static class DocumentPointer {
847847

848848
private BasicFileProvider fpInst;
849849
private boolean isValid;
@@ -932,13 +932,21 @@ public StringBuilder readFileContentsAsString(int offset, int maxBytes) {
932932
return fpInst.readFileContentsAsString(documentId, offset, maxBytes);
933933
}
934934

935+
public StringBuilder readFileContentsAsString() {
936+
return readFileContentsAsString(0, Integer.MAX_VALUE);
937+
}
938+
935939
public byte[] readFileContentsAsByteArray(int offset, int maxBytes) {
936940
if(!isValid() || documentId == null) {
937941
return null;
938942
}
939943
return fpInst.readFileContentsAsByteArray(documentId, offset, maxBytes);
940944
}
941945

946+
public byte[] readFileContentsAsByteArray() {
947+
return readFileContentsAsByteArray(0, Integer.MAX_VALUE);
948+
}
949+
942950
}
943951

944952
}

0 commit comments

Comments
 (0)