* @throws SysException
*/
public void setValue(String value) throws SysException {
int l = value.length();
if (l / (bytes ? 2 : 1) > maxl)
throw new SysException("Inequality data and format for field \""
+ name + "\"");
if ((vl == 0 && l / (bytes ? 2 : 1) < maxl) || (vl > 0 & l / (bytes ? 2 : 1) >= Math.pow(10, vl)))
throw new SysException("Inequality data and format for field \""
+ name + "\"");
// Записать тело
if (isHexB) { // TODO
int i = isHexH ? vl / 2 + vl % 2 : vl;
int j = 0;
int k = 0;
if (l % 2 != 0 && !left) {
dta[i] = (byte) (Byte.parseByte(value.substring(j, j + 1), 16) & 0xff);
k = 1;
}
for (; j + k < l; j++) {
int b = Byte.parseByte(value.substring(j + k, j + k + 1), 16) << 4;
j++;
if (j + k < l)
b = b
| Byte.parseByte(value.substring(j + k, j + k + 1),
16);
dta[i + k + (j >> 1)] = (byte) (0xff & b);
}
} else {
int i = isHexH ? vl / 2 + vl % 2 : vl;
byte[] buf;
try {
buf = value.getBytes(charset);
} catch (UnsupportedEncodingException e) {
throw new SysException(e);
}
System.arraycopy(buf, 0, dta, i, buf.length);
}
// Установка длины
if (vl > 0) {