Class ReadableDevice

java.lang.Object
io.ciera.runtime.api.types.Device
io.ciera.runtime.api.types.ReadableDevice
Direct Known Subclasses:
ReadWriteDevice

public class ReadableDevice extends Device
  • Constructor Details

  • Method Details

    • read

      public <T> T read(Class<T> cls)
      Description copied from class: Device
      Read a single token from the device stream and attempt to convert the token to type cls. The tokenization of the stream is left up to the individual implementation, however, by default tokens are delimited by whitespace.
      Specified by:
      read in class Device
      Parameters:
      cls - The type to interpret tokens as.
      Returns:
      A parsed instance of the type represented by the token.
    • readLine

      public String readLine()
      Description copied from class: Device
      Read a single line from the stream and return as a String. The line terminator is determined by the system.
      Specified by:
      readLine in class Device
      Returns:
      a line of text from the stream.
    • write

      public void write(Object o)
      Description copied from class: Device
      Convert an instance of an object to a String and append to the stream.
      Specified by:
      write in class Device
      Parameters:
      o - The instance to write.
    • writeLine

      public void writeLine(Object o)
      Description copied from class: Device
      Convert an instance of an object to a String and append to the stream. Append an additional line separator. The line separator is determined by the system.
      Specified by:
      writeLine in class Device
    • flush

      public void flush()
      Description copied from class: Device
      Flush the output stream.
      Specified by:
      flush in class Device