Package totalcross

Class Launcher.IS2S

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable
    Enclosing class:
    Launcher

    public static class Launcher.IS2S
    extends Stream
    Converts a java.io.InputStream into a totalcross.io.Stream
    • Constructor Detail

      • IS2S

        public IS2S​(java.io.InputStream is)
    • Method Detail

      • close

        public void close()
        Closes this I/O connection, releasing any associated resources. Once closed a connection is no longer valid.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
      • readBytes

        public int readBytes​(byte[] buf,
                             int start,
                             int count)
        Description copied from class: Stream
        Reads bytes from the stream. Returns the number of bytes actually read or -1 if the end of the stream was reached. (if applicable to the stream)
        Specified by:
        readBytes in class Stream
        Parameters:
        buf - the byte array to read data into
        start - the start position in the array
        count - the number of bytes to read
      • writeBytes

        public int writeBytes​(byte[] buf,
                              int start,
                              int count)
        Description copied from class: Stream
        Writes bytes to the stream. Returns the number of bytes actually written or throws an IOException if an error prevented the write operation from occurring.
        Specified by:
        writeBytes in class Stream
        Parameters:
        buf - the byte array to write data from
        start - the start position in the byte array
        count - the number of bytes to write
        Returns:
        the number of bytes actually written