com.teraspaces.qwframework
Class FIXFormatAlgorithm

java.lang.Object
  extended by com.teraspaces.qwframework.FIXFormatAlgorithm

public final class FIXFormatAlgorithm
extends Object

Used by QWFIX internally.


Constructor Summary
FIXFormatAlgorithm()
           
 
Method Summary
static int encodeIntValue(int value, byte[] buffer, int start)
          Encodes an integer value into a buffer.
static void encodeIntValue(int value, StringBuilder sb)
          Encodes an integer into a string builder.
static int encodeUIntValue(int value, byte[] buffer, int start, int len)
          Encodes unsigned integer into a buffer.
static void encodeUIntValue(int value, StringBuilder sb, int len)
          Encodes an unsigned integer value into string.
static int intLength(int value)
          Calculates the encoded length of an integer.
static int numberFromString(String s, int start, int len)
          Parses an integer number from a string.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FIXFormatAlgorithm

public FIXFormatAlgorithm()
Method Detail

intLength

public static int intLength(int value)
Calculates the encoded length of an integer.

Parameters:
value - the value
Returns:
the encoded length

encodeIntValue

public static int encodeIntValue(int value,
                                 byte[] buffer,
                                 int start)
Encodes an integer value into a buffer.

Parameters:
value - the value
buffer - the buffer
start - the start position
Returns:
the position after encoding

encodeIntValue

public static void encodeIntValue(int value,
                                  StringBuilder sb)
Encodes an integer into a string builder.

Parameters:
value - the value
sb - the buffer

encodeUIntValue

public static int encodeUIntValue(int value,
                                  byte[] buffer,
                                  int start,
                                  int len)
Encodes unsigned integer into a buffer.

Parameters:
value - the value
buffer - the buffer
start - the start position
len - the length
Returns:
the position after encoding

encodeUIntValue

public static void encodeUIntValue(int value,
                                   StringBuilder sb,
                                   int len)
Encodes an unsigned integer value into string.

Parameters:
value - the value
sb - the buffer
len - the length

numberFromString

public static int numberFromString(String s,
                                   int start,
                                   int len)
Parses an integer number from a string.

Parameters:
s - the input string
start - the start position
len - the length
Returns:
the result