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
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungint
void
close()
Closes the stream, signaling that no more data will be written.int
read()
Reads the next byte of data from the stream.int
read
(byte[] b, int off, int len) Reads up to len bytes of data from the stream into an array of bytes.void
write
(byte[] data) Writes data to the stream.void
write
(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:
close
in SchnittstelleAutoCloseable
- Angegeben von:
close
in SchnittstelleCloseable
- Setzt außer Kraft:
close
in 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:
read
in 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:
read
in 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:
available
in KlasseInputStream
- Löst aus:
IOException
-