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
-
-
Constructor Summary
Constructors Constructor Description StreamConnection()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract InputStream
getInputStream()
protected abstract OutputStream
getOutputStream()
Packet<com.sass_lang.embedded_protocol.OutboundMessage>
readResponse()
Read aOutboundMessage
from the compiler.void
sendMessage(Packet<com.sass_lang.embedded_protocol.InboundMessage> packet)
Send the givenPacket
to the compiler.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.larsgrefer.sass.embedded.connection.CompilerConnection
sendMessage
-
-
-
-
Method Detail
-
getInputStream
protected abstract InputStream getInputStream() throws IOException
- Throws:
IOException
-
getOutputStream
protected abstract OutputStream getOutputStream() throws IOException
- Throws:
IOException
-
sendMessage
public void sendMessage(Packet<com.sass_lang.embedded_protocol.InboundMessage> packet) throws IOException
Description copied from interface:CompilerConnection
Send the givenPacket
to the compiler.- Specified by:
sendMessage
in interfaceCompilerConnection
- Parameters:
packet
- TheInboundMessage
to send.- Throws:
IOException
- If the communication with the compiler fails.
-
readResponse
public Packet<com.sass_lang.embedded_protocol.OutboundMessage> readResponse() throws IOException
Description copied from interface:CompilerConnection
Read aOutboundMessage
from the compiler.- Specified by:
readResponse
in interfaceCompilerConnection
- Returns:
- The next
OutboundMessage
sent by the compiler. - Throws:
IOException
- If the communication with the compiler fails.
-
-