@Override public Map<K, V> decode(byte[] b) { byte[][] escapedElements = split(b); Map<K, V> decodedMap = new HashMap<>(); for (int i = 0; i < escapedElements.length; i += 2) { K key = keyLexicoder.decode(unescape(escapedElements[i])); V value = valueLexicoder.decode(unescape(escapedElements[i + 1])); decodedMap.put(key, value); } return decodedMap; } }
@Override public byte[] encode(Map<K, V> v) { byte[][] elements = new byte[v.size() * 2][]; int index = 0; for (Entry<K, V> entry : v.entrySet()) { elements[index++] = escape(keyLexicoder.encode(entry.getKey())); elements[index++] = escape(valueLexicoder.encode(entry.getValue())); } return concat(elements); }
@Override public List<LT> decode(byte[] b) { // This concrete implementation is provided for binary compatibility with 1.6; it can be removed // in 2.0. See ACCUMULO-3789. return super.decode(b); }
/** * Splits a byte array by 0x00 */ public static byte[][] split(byte[] data) { return split(data, 0, data.length); }
@Override public Integer decode(byte[] b) { // This concrete implementation is provided for binary compatibility with 1.6; it can be removed // in 2.0. See ACCUMULO-3789. return super.decode(b); }
@Override public BigDecimal decode(byte[] b) { // This concrete implementation is provided for binary compatibility with 1.6; it can be // removed in 2.0. See ACCUMULO-3789. return super.decode(b); }
@Override public Long decode(byte[] b) { // This concrete implementation is provided for binary compatibility with 1.6; it can be // removed in 2.0. See ACCUMULO-3789. return super.decode(b); }
@Override public String decode(byte[] b) { // This concrete implementation is provided for binary compatibility with 1.6; it can be removed // in 2.0. See ACCUMULO-3789. return super.decode(b); }
@Override public Integer decode(byte[] b) { // This concrete implementation is provided for binary compatibility with 1.6; it can be removed in 2.0. See ACCUMULO-3789. return super.decode(b); }
@Override public Double decode(byte[] b) { // This concrete implementation is provided for binary compatibility with 1.6; it can be removed // in 2.0. See ACCUMULO-3789. return super.decode(b); }
@Override public BigInteger decode(byte[] b) { // This concrete implementation is provided for binary compatibility with 1.6; it can be removed // in 2.0. See ACCUMULO-3789. return super.decode(b); }
@Override public Text decode(byte[] b) { // This concrete implementation is provided for binary compatibility with 1.6; it can be removed // in 2.0. See ACCUMULO-3789. return super.decode(b); }
@Override public Long decode(byte[] b) { // This concrete implementation is provided for binary compatibility with 1.6; it can be // removed in 2.0. See ACCUMULO-3789. return super.decode(b); }
@Override public Integer decode(byte[] b) { return super.decode(b); }
@Override public Integer decode(byte[] b) { // This concrete implementation is provided for binary compatibility with 1.6; it can be removed // in 2.0. See ACCUMULO-3789. return super.decode(b); }
@Override public UUID decode(byte[] b) { // This concrete implementation is provided for binary compatibility with 1.6; it can be removed // in 2.0. See ACCUMULO-3789. return super.decode(b); }
@Override public ComparablePair<A,B> decode(byte[] b) { // This concrete implementation is provided for binary compatibility with 1.6; it can be removed // in 2.0. See ACCUMULO-3789. return super.decode(b); }
@Override public Float decode(byte[] b) { // This concrete implementation is provided for binary compatibility with 1.6; it can be removed // in 2.0. See ACCUMULO-3789. return super.decode(b); }
@Override public Date decode(byte[] b) { // This concrete implementation is provided for binary compatibility with 1.6; it can be removed // in 2.0. See ACCUMULO-3789. return super.decode(b); }
@Override public Long decode(byte[] b) { // This concrete implementation is provided for binary compatibility with 1.6; it can be removed // in 2.0. See ACCUMULO-3789. return super.decode(b); } }