mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-12-23 16:40:32 +00:00
Add comments to SharpStreams
This commit is contained in:
parent
bcb1cf6603
commit
eea43d5a73
@ -5,6 +5,10 @@ import androidx.annotation.NonNull;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
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 {
|
public class SharpInputStream extends InputStream {
|
||||||
private final SharpStream stream;
|
private final SharpStream stream;
|
||||||
|
|
||||||
|
@ -5,6 +5,10 @@ import androidx.annotation.NonNull;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
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 {
|
public class SharpOutputStream extends OutputStream {
|
||||||
private final SharpStream stream;
|
private final SharpStream stream;
|
||||||
|
|
||||||
|
@ -5,7 +5,14 @@ import java.io.Flushable;
|
|||||||
import java.io.IOException;
|
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 class SharpStream implements Closeable, Flushable {
|
||||||
public abstract int read() throws IOException;
|
public abstract int read() throws IOException;
|
||||||
|
Loading…
Reference in New Issue
Block a user