Klasse WritableInputStream

java.lang.Object
java.io.InputStream
de.mrjulsen.dragnsounds.core.data.WritableInputStream
Alle implementierten Schnittstellen:
Closeable, AutoCloseable

public class WritableInputStream extends InputStream
A thread-safe implementation of an InputStream that allows data to be written to it at any time.
  • Konstruktordetails

    • WritableInputStream

      public WritableInputStream()
  • Methodendetails

    • write

      public void write(byte[] data) throws IOException
      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

      public void write(byte[] data, int len) throws IOException
      Löst aus:
      IOException
    • close

      public void close()
      Closes the stream, signaling that no more data will be written.
      Angegeben von:
      close in Schnittstelle AutoCloseable
      Angegeben von:
      close in Schnittstelle Closeable
      Setzt außer Kraft:
      close in Klasse InputStream
    • read

      public int read() throws IOException
      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 Klasse InputStream
      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

      public int read(byte[] b, int off, int len) throws IOException
      Reads up to len bytes of data from the stream into an array of bytes.
      Setzt außer Kraft:
      read in Klasse InputStream
      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

      public int available() throws IOException
      Setzt außer Kraft:
      available in Klasse InputStream
      Löst aus:
      IOException