net.spy.util
Class NetStringDecoder

java.lang.Object
  extended bynet.spy.SpyObject
      extended bynet.spy.util.NetStringDecoder

public class NetStringDecoder
extends SpyObject

Decode netstrings. See netstring spec.


Constructor Summary
NetStringDecoder(String encoding)
          Get an instance of NetStringDecoder.
 
Method Summary
 String decodeString(InputStream is)
          Pull a netstring from the given InputStream and decode it.
 
Methods inherited from class net.spy.SpyObject
getLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetStringDecoder

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

Method Detail

decodeString

public String decodeString(InputStream is)
                    throws IOException
Pull a netstring from the given InputStream and decode it.

Parameters:
is - a stream containing a netstring
Returns:
the String representing the netstring at the beginning of this stream
Throws:
IOException - if there is a problem decoding the netstring