net.spy.util
Class NetStringEncoder

java.lang.Object
  extended bynet.spy.util.NetStringEncoder

public class NetStringEncoder
extends Object

Encode netstrings. See netstring spec.


Constructor Summary
NetStringEncoder(String encoding)
          Get an instance of NetStringEncoder.
 
Method Summary
 void encodeString(String s, OutputStream os)
          Encode a String as a netstring to the given output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetStringEncoder

public NetStringEncoder(String encoding)
Get an instance of NetStringEncoder.

Method Detail

encodeString

public final void encodeString(String s,
                               OutputStream os)
                        throws IOException
Encode a String as a netstring to the given output stream.

Parameters:
s - the string
os - the stream
Throws:
IOException - if there's a problem writing to the string