step.encoding
Class StringEncoder
java.lang.Object
|
+--step.encoding.Encoder
|
+--step.encoding.StringEncoder
- public class StringEncoder
- extends Encoder
An encoder for STEP string
objects.
- See Also:
StepString
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StringEncoder
public StringEncoder(String name,
String charset,
FieldDef lengthDef,
EncoderFactory factory)
- Create a new encoder for STEP
string
objects.
- Parameters:
name
- the name of this encodercharset
- the character set to use when converting values to byteslengthDef
- a definition for the (integer) length of string objectsfactory
- the EncoderFactory
used to create this encoder
- Throws:
IllegalArgumentException
- if the length definition does not handle
StepInt
values.- See Also:
java.nio.charset.Charset
encode
public void encode(StepObject o,
EncodeContext context)
throws EncoderException,
IOException
- Encode a STEP
string
value.
- Specified by:
encode
in class Encoder
- Throws:
EncoderException
- if the value is not a StepString
.
IOException
- if the encode operation encountered an I/O failure.
decode
public StepObject decode(DecodeContext context)
throws EncoderException,
IOException
- Decode a STEP
string
value.
- Specified by:
decode
in class Encoder
- Throws:
IOException
- if the decode operation encountered an I/O failure.
EncoderException
- if the decode operation encountered an error.
dump
public void dump(int level)
- Specified by:
dump
in class Encoder