Add comments to SharpStreams

pull/5415/head
Stypox 2021-01-16 14:35:15 +01:00
rodzic bcb1cf6603
commit eea43d5a73
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4BDF1B40A49FDD23
3 zmienionych plików z 16 dodań i 1 usunięć

Wyświetl plik

@ -5,6 +5,10 @@ import androidx.annotation.NonNull;
import java.io.IOException;
import java.io.InputStream;
/**
* Simply wraps a readable {@link SharpStream} allowing it to be used with built-in Java stuff that
* supports {@link InputStream}.
*/
public class SharpInputStream extends InputStream {
private final SharpStream stream;

Wyświetl plik

@ -5,6 +5,10 @@ import androidx.annotation.NonNull;
import java.io.IOException;
import java.io.OutputStream;
/**
* Simply wraps a writable {@link SharpStream} allowing it to be used with built-in Java stuff that
* supports {@link OutputStream}.
*/
public class SharpOutputStream extends OutputStream {
private final SharpStream stream;

Wyświetl plik

@ -5,7 +5,14 @@ import java.io.Flushable;
import java.io.IOException;
/**
* Based on C#'s Stream class.
* Based on C#'s Stream class. SharpStream is a wrapper around the 2 different APIs for SAF
* ({@link us.shandian.giga.io.FileStreamSAF}) and non-SAF ({@link us.shandian.giga.io.FileStream}).
* It has both input and output like in C#, while in Java those are usually different classes.
* {@link SharpInputStream} and {@link SharpOutputStream} are simple classes that wrap
* {@link SharpStream} and extend respectively {@link java.io.InputStream} and
* {@link java.io.OutputStream}, since unfortunately a class can only extend one class, so that a
* sharp stream can be used with built-in Java stuff that supports {@link java.io.InputStream}
* or {@link java.io.OutputStream}.
*/
public abstract class SharpStream implements Closeable, Flushable {
public abstract int read() throws IOException;