public class Argument
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.List<java.lang.Object> |
items |
Constructor and Description |
---|
Argument()
Constructor
|
Modifier and Type | Method and Description |
---|---|
Argument |
append(Argument arg)
Append the given Argument to this Argument.
|
private void |
astring(byte[] bytes,
Protocol protocol)
Write out given String as either an Atom, QuotedString or Literal
|
private void |
literal(byte[] b,
Protocol protocol)
Write out given byte[] as a literal
|
private void |
literal(java.io.ByteArrayOutputStream b,
Protocol protocol)
Write out given ByteArrayOutputStream as a literal.
|
private void |
literal(Literal b,
Protocol protocol)
Write out given Literal as a literal.
|
private void |
nastring(byte[] bytes,
Protocol protocol,
boolean doQuote) |
private void |
nstring(byte[] bytes,
Protocol protocol)
Write out given String as either NIL, QuotedString, or Literal.
|
private java.io.OutputStream |
startLiteral(Protocol protocol,
int size) |
void |
write(Protocol protocol) |
Argument |
writeArgument(Argument c)
Write out as parenthesised list.
|
Argument |
writeAtom(java.lang.String s)
Write out given string as an Atom.
|
Argument |
writeBytes(byte[] b)
Write out given byte[] as a Literal.
|
Argument |
writeBytes(java.io.ByteArrayOutputStream b)
Write out given ByteArrayOutputStream as a Literal.
|
Argument |
writeBytes(Literal b)
Write out given data as a literal.
|
Argument |
writeNString(java.lang.String s)
Write out given string as an NSTRING, depending on the type
of the characters inside the string.
|
Argument |
writeNString(java.lang.String s,
java.nio.charset.Charset charset)
Convert the given string into bytes in the specified
charset, and write the bytes out as an NSTRING
|
Argument |
writeNString(java.lang.String s,
java.lang.String charset)
Convert the given string into bytes in the specified
charset, and write the bytes out as an NSTRING
|
Argument |
writeNumber(int i)
Write out number.
|
Argument |
writeNumber(long i)
Write out number.
|
Argument |
writeString(java.lang.String s)
Write out given string as an ASTRING, depending on the type
of the characters inside the string.
|
Argument |
writeString(java.lang.String s,
java.nio.charset.Charset charset)
Convert the given string into bytes in the specified
charset, and write the bytes out as an ASTRING
|
Argument |
writeString(java.lang.String s,
java.lang.String charset)
Convert the given string into bytes in the specified
charset, and write the bytes out as an ASTRING
|
public Argument append(Argument arg)
arg
- the Argument to appendpublic Argument writeString(java.lang.String s)
XXX: Hmm .. this should really be called writeASCII()
s
- String to write outpublic Argument writeString(java.lang.String s, java.lang.String charset) throws java.io.UnsupportedEncodingException
s
- String to write outcharset
- the charsetjava.io.UnsupportedEncodingException
- for bad charsetpublic Argument writeString(java.lang.String s, java.nio.charset.Charset charset)
s
- String to write outcharset
- the charsetpublic Argument writeNString(java.lang.String s)
s
- String to write outpublic Argument writeNString(java.lang.String s, java.lang.String charset) throws java.io.UnsupportedEncodingException
s
- String to write outcharset
- the charsetjava.io.UnsupportedEncodingException
- for bad charsetpublic Argument writeNString(java.lang.String s, java.nio.charset.Charset charset)
s
- String to write outcharset
- the charsetpublic Argument writeBytes(byte[] b)
b
- byte[] to write outpublic Argument writeBytes(java.io.ByteArrayOutputStream b)
b
- ByteArrayOutputStream to be written out.public Argument writeBytes(Literal b)
b
- Literal representing data to be written out.public Argument writeAtom(java.lang.String s)
s
- Stringpublic Argument writeNumber(int i)
i
- numberpublic Argument writeNumber(long i)
i
- numberpublic Argument writeArgument(Argument c)
c
- the Argumentpublic void write(Protocol protocol) throws java.io.IOException, ProtocolException
java.io.IOException
ProtocolException
private void astring(byte[] bytes, Protocol protocol) throws java.io.IOException, ProtocolException
java.io.IOException
ProtocolException
private void nstring(byte[] bytes, Protocol protocol) throws java.io.IOException, ProtocolException
java.io.IOException
ProtocolException
private void nastring(byte[] bytes, Protocol protocol, boolean doQuote) throws java.io.IOException, ProtocolException
java.io.IOException
ProtocolException
private void literal(byte[] b, Protocol protocol) throws java.io.IOException, ProtocolException
java.io.IOException
ProtocolException
private void literal(java.io.ByteArrayOutputStream b, Protocol protocol) throws java.io.IOException, ProtocolException
java.io.IOException
ProtocolException
private void literal(Literal b, Protocol protocol) throws java.io.IOException, ProtocolException
java.io.IOException
ProtocolException
private java.io.OutputStream startLiteral(Protocol protocol, int size) throws java.io.IOException, ProtocolException
java.io.IOException
ProtocolException