public class SocketMessageStreamWriter extends Object implements MessageStreamWriter
Modifier and Type | Class and Description |
---|---|
static class |
SocketMessageStreamWriter.BufferedStream |
static interface |
SocketMessageStreamWriter.Out |
Constructor and Description |
---|
SocketMessageStreamWriter(ClosableOutputStream socket,
Charset charset,
ObjectByteWriter writer) |
SocketMessageStreamWriter(SocketMessageStreamWriter.Out socket,
Charset charset,
ObjectByteWriter writer) |
Modifier and Type | Method and Description |
---|---|
void |
setPositionAndFlush(int position) |
boolean |
tryClose() |
void |
write(String topic,
Object msg) |
void |
writeByteAsInt(int byteToWrite) |
void |
writeBytes(byte[] bytes) |
void |
writeIntoBuffer(String topic,
Object req) |
void |
writeReply(int reqId,
String requestTopic,
Object replyMsg) |
void |
writeRequest(int id,
String reqTopic,
Object req) |
void |
writeSubscription(int msgType,
String subject,
Charset charset) |
int |
writeWithoutFlush(String topic,
Object msg) |
public SocketMessageStreamWriter(SocketMessageStreamWriter.Out socket, Charset charset, ObjectByteWriter writer)
public SocketMessageStreamWriter(ClosableOutputStream socket, Charset charset, ObjectByteWriter writer) throws IOException
IOException
public void writeByteAsInt(int byteToWrite) throws IOException
writeByteAsInt
in interface MessageStreamWriter
IOException
public void writeSubscription(int msgType, String subject, Charset charset) throws IOException
writeSubscription
in interface MessageStreamWriter
IOException
public boolean tryClose()
tryClose
in interface MessageStreamWriter
public void write(String topic, Object msg) throws IOException
write
in interface MessageStreamWriter
IOException
public int writeWithoutFlush(String topic, Object msg) throws IOException
IOException
public void setPositionAndFlush(int position) throws IOException
IOException
public void writeRequest(int id, String reqTopic, Object req) throws IOException
writeRequest
in interface MessageStreamWriter
IOException
public void writeReply(int reqId, String requestTopic, Object replyMsg) throws IOException
writeReply
in interface MessageStreamWriter
IOException
public void writeIntoBuffer(String topic, Object req) throws IOException
IOException
public void writeBytes(byte[] bytes) throws IOException
writeBytes
in interface MessageStreamWriter
IOException
Copyright © 2016. All Rights Reserved.