Klasse WritableInputStream
java.lang.Object
java.io.InputStream
de.mrjulsen.dragnsounds.core.data.WritableInputStream
- Alle implementierten Schnittstellen:
Closeable,AutoCloseable
A thread-safe implementation of an InputStream that allows data to be written
to it at any time.
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungintvoidclose()Closes the stream, signaling that no more data will be written.intread()Reads the next byte of data from the stream.intread(byte[] b, int off, int len) Reads up to len bytes of data from the stream into an array of bytes.voidwrite(byte[] data) Writes data to the stream.voidwrite(byte[] data, int len) Von Klasse geerbte Methoden java.io.InputStream
mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Konstruktordetails
-
WritableInputStream
public WritableInputStream()
-
-
Methodendetails
-
write
Writes data to the stream. This method can be called from another thread.- Parameter:
data- The data to write to the stream.- Löst aus:
IOException- If the stream is closed.
-
write
- Löst aus:
IOException
-
close
public void close()Closes the stream, signaling that no more data will be written.- Angegeben von:
closein SchnittstelleAutoCloseable- Angegeben von:
closein SchnittstelleCloseable- Setzt außer Kraft:
closein KlasseInputStream
-
read
Reads the next byte of data from the stream. If no data is available, this method blocks until data is written or the stream is closed.- Angegeben von:
readin KlasseInputStream- Gibt zurück:
- The next byte of data, or -1 if the stream is closed and no more data is available.
- Löst aus:
IOException- If an I/O error occurs.
-
read
Reads up to len bytes of data from the stream into an array of bytes.- Setzt außer Kraft:
readin KlasseInputStream- Parameter:
b- The buffer into which the data is read.off- The start offset in array b at which the data is written.len- The maximum number of bytes to read.- Gibt zurück:
- The total number of bytes read into the buffer, or -1 if the stream is closed and no more data is available.
- Löst aus:
IOException- If an I/O error occurs.
-
available
- Setzt außer Kraft:
availablein KlasseInputStream- Löst aus:
IOException
-