org.jetlang.remote.core

## Class SocketMessageStreamWriter

- java.lang.Object
- - org.jetlang.remote.core.SocketMessageStreamWriter

All Implemented Interfaces:
  MessageStreamWriter

    public class SocketMessageStreamWriter
    extends Object
    implements MessageStreamWriter

User: mrettig Date: 4/6/11 Time: 8:52 AM

### Nested Class Summary

Nested Classes
`static class` `SocketMessageStreamWriter.BufferedStream`
`static interface` `SocketMessageStreamWriter.Out`

### Constructor Summary

Constructors
Constructor and Description
`SocketMessageStreamWriter(ClosableOutputStream socket, Charset charset, ObjectByteWriter writer)`
`SocketMessageStreamWriter(SocketMessageStreamWriter.Out socket, Charset charset, ObjectByteWriter writer)`

### Method Summary

All Methods Instance Methods Concrete Methods
`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)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### SocketMessageStreamWriter

    public SocketMessageStreamWriter(SocketMessageStreamWriter.Out socket,
                                     Charset charset,
                                     ObjectByteWriter writer)

#### SocketMessageStreamWriter

    public SocketMessageStreamWriter(ClosableOutputStream socket,
                                     Charset charset,
                                     ObjectByteWriter writer)
                              throws IOException

Throws:
  `IOException`

### Method Detail

#### writeByteAsInt

    public void writeByteAsInt(int byteToWrite)
                        throws IOException

Specified by:
  `writeByteAsInt` in interface `MessageStreamWriter`
Throws:
  `IOException`

#### writeSubscription

    public void writeSubscription(int msgType,
                                  String subject,
                                  Charset charset)
                           throws IOException

Specified by:
  `writeSubscription` in interface `MessageStreamWriter`
Throws:
  `IOException`

#### tryClose

    public boolean tryClose()

Specified by:
  `tryClose` in interface `MessageStreamWriter`

#### write

    public void write(String topic,
                      Object msg)
               throws IOException

Specified by:
  `write` in interface `MessageStreamWriter`
Throws:
  `IOException`

#### writeWithoutFlush

    public int writeWithoutFlush(String topic,
                                 Object msg)
                          throws IOException

Throws:
  `IOException`

#### setPositionAndFlush

    public void setPositionAndFlush(int position)
                             throws IOException

Throws:
  `IOException`

#### writeRequest

    public void writeRequest(int id,
                             String reqTopic,
                             Object req)
                      throws IOException

Specified by:
  `writeRequest` in interface `MessageStreamWriter`
Throws:
  `IOException`

#### writeReply

    public void writeReply(int reqId,
                           String requestTopic,
                           Object replyMsg)
                    throws IOException

Specified by:
  `writeReply` in interface `MessageStreamWriter`
Throws:
  `IOException`

#### writeIntoBuffer

    public void writeIntoBuffer(String topic,
                                Object req)
                         throws IOException

Throws:
  `IOException`

#### writeBytes

    public void writeBytes(byte[] bytes)
                    throws IOException

Specified by:
  `writeBytes` in interface `MessageStreamWriter`
Throws:
  `IOException`