Class StreamConnection

java.lang.Object
de.larsgrefer.sass.embedded.connection.StreamConnection
All Implemented Interfaces:
CompilerConnection, Closeable, AutoCloseable
Direct Known Subclasses:
ProcessConnection, SocketConnection

public abstract class StreamConnection extends Object implements CompilerConnection
CompilerConnection implementation based on an InputStream OutputStream pair.
  • Constructor Details

    • StreamConnection

      public StreamConnection()
  • Method Details

    • getInputStream

      protected abstract InputStream getInputStream() throws IOException
      Throws:
      IOException
    • getOutputStream

      protected abstract OutputStream getOutputStream() throws IOException
      Throws:
      IOException
    • sendMessage

      public void sendMessage(sass.embedded_protocol.EmbeddedSass.InboundMessage inboundMessage) throws IOException
      Description copied from interface: CompilerConnection
      Send the given EmbeddedSass.InboundMessage to the compiler.
      Specified by:
      sendMessage in interface CompilerConnection
      Parameters:
      inboundMessage - The EmbeddedSass.InboundMessage to send.
      Throws:
      IOException - If the communication with the compiler fails.
    • readResponse

      public sass.embedded_protocol.EmbeddedSass.OutboundMessage readResponse() throws IOException
      Description copied from interface: CompilerConnection
      Read a EmbeddedSass.OutboundMessage from the compiler.
      Specified by:
      readResponse in interface CompilerConnection
      Returns:
      The next EmbeddedSass.OutboundMessage sent by the compiler.
      Throws:
      IOException - If the communication with the compiler fails.