public static int encodeSingleValue(String mapName, String key, Object value, ByteBuffer buffer) {
        if (value == null) return 0;

        byte [] utf8 = Utf8.toBytes(mapName);
        buffer.putInt(utf8.length);
        buffer.put(utf8);
        buffer.putInt(1);
        utf8 = Utf8.toBytes(key);
        buffer.putInt(utf8.length);
        buffer.put(utf8);
        utf8 = getUtf8(value);
        buffer.putInt(utf8.length);
        buffer.put(utf8);

        return 1;
    }
Encodes a single value as a complete binary map.
Does nothing if the value is null.

Returns the number of maps encoded - 0 or 1
container-search/src/main/java/com/yahoo/fs4/MapEncoder.java