jsdsi.sexp
Class SimpleString

java.lang.Object
  |
  +--jsdsi.sexp.SimpleString
All Implemented Interfaces:
java.io.Serializable

class SimpleString
extends java.lang.Object
implements java.io.Serializable

A simple string of data.

Author:
Alexander Morcos, Sameer Ajmani

Constructor Summary
(package private) SimpleString(byte[] d)
          Creates a new SimpleString.
(package private) SimpleString(java.lang.String s)
          Create a new SimpleString.
 
Method Summary
(package private)  boolean canBeHex()
           
(package private)  boolean canBeQuoted()
           
(package private)  boolean canBeQuotedImpl()
           
(package private)  boolean canBeToken()
           
(package private)  int getReadableLen()
           
 byte[] toByteArray()
          Returns the content of this string as a byte array.
 java.lang.String toString()
          Returns the content of this string as a String.
(package private)  void writeBase64(java.io.Writer out, int offset, int width, int last)
           
 void writeCanonical(java.io.OutputStream out)
          Writes this string to a byte stream in canonical form.
(package private)  void writeHex(java.io.Writer out, int offset, int width, int last)
           
(package private)  void writeQuoted(java.io.Writer out, int offset, int width, int last)
           
 void writeReadable(java.io.Writer out, int offset, int width, int last)
          Writes this string to a character stream in readable form.
(package private)  void writeToken(java.io.Writer out, int offset, int width, int last)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleString

SimpleString(byte[] d)
Creates a new SimpleString.

Parameters:
d - the content of the string

SimpleString

SimpleString(java.lang.String s)
Create a new SimpleString.

Parameters:
s - the content of the string
Method Detail

toString

public java.lang.String toString()
Returns the content of this string as a String.

Overrides:
toString in class java.lang.Object

toByteArray

public byte[] toByteArray()
Returns the content of this string as a byte array.


writeCanonical

public void writeCanonical(java.io.OutputStream out)
                    throws java.io.IOException
Writes this string to a byte stream in canonical form.

java.io.IOException

writeReadable

public void writeReadable(java.io.Writer out,
                          int offset,
                          int width,
                          int last)
                   throws java.io.IOException
Writes this string to a character stream in readable form.

Parameters:
offset - spaces indented from left
width - total width of window, in characters
last - spaces reserved on right (e.g., for closing parens)
java.io.IOException

getReadableLen

int getReadableLen()

canBeToken

boolean canBeToken()

canBeQuoted

boolean canBeQuoted()

canBeQuotedImpl

boolean canBeQuotedImpl()

canBeHex

boolean canBeHex()

writeToken

void writeToken(java.io.Writer out,
                int offset,
                int width,
                int last)
          throws java.io.IOException
java.io.IOException

writeQuoted

void writeQuoted(java.io.Writer out,
                 int offset,
                 int width,
                 int last)
           throws java.io.IOException
java.io.IOException

writeHex

void writeHex(java.io.Writer out,
              int offset,
              int width,
              int last)
        throws java.io.IOException
java.io.IOException

writeBase64

void writeBase64(java.io.Writer out,
                 int offset,
                 int width,
                 int last)
           throws java.io.IOException
java.io.IOException