/** * Convenient form of * <code>getIdFromValueBytes(value, offset, len, 0)</code> */ final public int getIdFromValueBytes(byte[] value, int offset, int len) { return getIdFromValueBytes(value, offset, len, 0); }
public void writeColumn(TblColRef column, byte[] value, int valueLen, int roundingFlag, byte dft, byte[] output, int outputOffset) { Dictionary<String> dict = getDictionary(column); int columnLen = getColumnLength(column); // non-dict value if (dict == null) { byte[] valueBytes = padFixLen(columnLen, value); System.arraycopy(valueBytes, 0, output, outputOffset, columnLen); return; } // dict value try { int id = dict.getIdFromValueBytes(value, 0, valueLen, roundingFlag); BytesUtil.writeUnsigned(id, output, outputOffset, dict.getSizeOfId()); } catch (IllegalArgumentException ex) { for (int i = outputOffset; i < outputOffset + columnLen; i++) output[i] = dft; logger.error("Can't translate value " + Bytes.toString(value, 0, valueLen) + " to dictionary ID, roundingFlag " + roundingFlag + ". Using default value " + String.format("\\x%02X", dft)); } }
idInMergedDict = mergedDict.nullId(); } else { idInMergedDict = mergedDict.getIdFromValueBytes(newKeyBuf, bufOffset, size);