APIMethod: read
Deserialize an encoded polyline string and return a vector feature.

Parameters:
encoded - {String} An encoded polyline string

Returns:
{<OpenLayers.Feature.Vector>} A vector feature with a linestring.
777706
function(encoded) {
        var geomType;
        if (this.geometryType == "linestring")
            geomType = OpenLayers.Geometry.LineString;
        else if (this.geometryType == "linearring")
            geomType = OpenLayers.Geometry.LinearRing;
        else if (this.geometryType == "multipoint")
            geomType = OpenLayers.Geometry.MultiPoint;
        else if (this.geometryType != "point" && this.geometryType != "polygon")
            return null;

        var flatPoints = this.decodeDeltas(encoded, 2);
        var flatPointsLength = flatPoints.length;

        var pointGeometries = [];
        for (var i = 0; i + 1 < flatPointsLength;) {
            var y = flatPoints[i++], x = flatPoints[i++];
            pointGeometries.push(new OpenLayers.Geometry.Point(x, y));
        }


        if (this.geometryType == "point")
            return new OpenLayers.Feature.Vector(
                pointGeometries[0]
            );

        if (this.geometryType == "polygon")
            return new OpenLayers.Feature.Vector(
                new OpenLayers.Geometry.Polygon([
                    new OpenLayers.Geometry.LinearRing(pointGeometries)
                ])
            );

        return new OpenLayers.Feature.Vector(
            new geomType(pointGeometries)
        );
    }
580347
function(encoded) {
      var numbers = this.decodeUnsignedIntegers(encoded);

      var numbersLength = numbers.length;
      for (var i = 0; i < numbersLength; ++i) {
        var num = numbers[i];
        numbers[i] = (num & 1) ? ~(num >> 1) : (num >> 1);
      }

      return numbers;
    }
320823
function _decodeBlob(encodedBlob) {
    var arrayBuff = _binStringToArrayBuffer(atob(encodedBlob.data));
    return createBlob([arrayBuff], { type: encodedBlob.type });
}
1361386
function readRawFeature(pbf, layer, i) {
  pbf.pos = layer.features[i];
  const end = pbf.readVarint() + pbf.pos;

  const feature = {
    layer: layer,
    type: 0,
    properties: {}
  };
  pbf.readFields(featurePBFReader, feature, end);
  return feature;
}
381232
def _decode(self, obj):
        
        if self.decode_responses and isinstance(obj, bytes):
            try:
                return obj.decode(self.encoding)
            except UnicodeDecodeError:
                return obj
        return obj
211933
def decode(cls, line):
        
        if line.encoded:
            line.value = stringToTextValues(line.value,
                listSeparator=cls.listSeparator)
            line.encoded=False
1000699
function decodeByteVector(x, N) {
  var point = 0;
  for (var i = 0; i < N; ++i) {
    point |= x.charCodeAt(i) << (i * 8);
  }
  return point;
}
369812
def decode(var, encoding):
    
    if PY2:
        if isinstance(var, unicode):
            ret = var
        elif isinstance(var, str):
            if encoding:
                ret = var.decode(encoding)
            else:
                ret = unicode(var)
        else:
            ret = unicode(var)
    else:
        ret = str(var)
    return ret
162826
function _parseVertex(line) {
        var vertex = JSON.parse(line);
        assert.ok(_smellsLikeAnElement(vertex));
        // A vertex is an object, i.e. a key,value map.
        // We don't sort the keys of the object, leaving that to jsonStableStringify below.
        // But a vertex values contain `property containers`, each of which may contain embedded arrays of elements.
        return _.mapValues(vertex, _sortPropertyContainers);
    }
1277508
public static String encodeLines(final byte[] input, final int iOff, final int iLen, final int lineLen,
           final String lineSeparator) {
       final int blockLen = (lineLen * CONSTANT_3) / CONSTANT_4;
       if (blockLen <= 0) {
           throw new IllegalArgumentException();
       }
       final int lines = (iLen + blockLen - 1) / blockLen;
       final int bufLen = ((iLen + 2) / CONSTANT_3) * CONSTANT_4 + lines * lineSeparator.length();
       final StringBuilder buf = new StringBuilder(bufLen);
       int ipValue = 0;
       while (ipValue < iLen) {
           final int length = Math.min(iLen - ipValue, blockLen);
           buf.append(encode(input, iOff + ipValue, length));
           buf.append(lineSeparator);
           ipValue += length;
       }
       return buf.toString();
   }
1347017
function postEncode(encoded, options) {
  if (options === null)
    return encoded

  return bytewise.postEncode(encoded, options)
}
156902
private static String decodeLineString(LineString lineString) {
		if (lineString == null || lineString.isEmpty()) {
			return "";
		}
		StringBuilder buffer = new StringBuilder();
		Coordinate[] coordinates = lineString.getCoordinates();
		for (int i = 0; i < coordinates.length; i++) {
			buffer.append(getX(coordinates[i]));
			buffer.append(" ");
			buffer.append(getY(coordinates[i]));
			if (i < (coordinates.length - 1)) {
				buffer.append(", ");
			}
		}
		return "M" + buffer.toString();
	}
353073
function generateLineString() {
  var coordNumber = getRandomNumber(3, options.maxCoordCount);

  var feature = rawFeature();
  feature.geometry.type = 'LineString';

  addCoordinates(feature.geometry.coordinates, coordNumber);

  return feature;
}
431350
public static List<ServiceRequester> deserialize(String encodedString) throws IOException {
    String base64Str = URLDecoder.decode(encodedString, "UTF-8");
    byte[] decodedBytes = Base64.getDecoder().decode(base64Str);
    String jsonList = new String(decodedBytes, "UTF-8");
    TypeReference<List<ServiceRequester>> mapType = new TypeReference<List<ServiceRequester>>() {};
    List<ServiceRequester> requesterList = objectMapper.readValue(jsonList, mapType);
    return requesterList;
  }
1104190
@Override
    public String decode( String encodedText ) {
        if (encodedText == null) return null;
        StringBuilder sb = new StringBuilder();
        CharacterIterator iter = new StringCharacterIterator(encodedText);
        for (char c = iter.first(); c != CharacterIterator.DONE; c = iter.next()) {
            if (c == '&') {
                int index = iter.getIndex();

                do {
                    // CHECKSTYLE IGNORE check FOR NEXT 1 LINES
                    c = iter.next();
                } while (c != CharacterIterator.DONE && c != ';');

                // We found a closing semicolon
                if (c == ';') {
                    String s = encodedText.substring(index + 1, iter.getIndex());

                    if (SPECIAL_ENTITIES.containsKey(s)) {
                        sb.append(SPECIAL_ENTITIES.get(s));
                        continue;

                    }

                    if (s.length() > 0 && s.charAt(0) == '#') {
                        try {
                            sb.append((char)Short.parseShort(s.substring(1, s.length())));
                            continue;
                        } catch (NumberFormatException nfe) {
                            // This is possible in malformed encodings, but let it fall through
                        }
                    }
                }

                // Malformed encoding, restore state and pass poorly encoded data back
                // CHECKSTYLE IGNORE check FOR NEXT 1 LINES
                c = '&';
                iter.setIndex(index);
            }

            sb.append(c);

        }
        return sb.toString();
    }
1258319
function decode(encoded, stack) {
    if (!stack) stack = [];

    if (encoded === undefined) return undefined;
    if (encoded === null) return null;

    var type = typeof(encoded);

    if (type === 'boolean') return encoded;
    if (type === 'number') return encoded;
    if (type === 'string') return encoded;

    if (type === 'object') {

      /* Native transfer of ArrayBuffer(s), views, dates, regular expressions */
      if (isBufferOrView(encoded)) return encoded;
      if (encoded instanceof Date) return encoded;
      if (encoded instanceof RegExp) return encoded;

      /* Errors */
      if (encoded["!$error$!"] != null) {
        return new RemoteError(encoded["!$error$!"]);
      }

      /* Functions */
      if (encoded["!$function$!"] != null) {
        return eval('(' + encoded["!$function$!"] + ')');
      }

      /* Native transfers */
      if (encoded["!$native$!"] != null) {
        return receiveNative(encoded["!$native$!"]);
      }

      /* Proxy references */
      if (encoded["!$proxyId$!"] != null) {
        return getProxy(encoded["!$proxyId$!"]);
      }

      /* Other (normal) object and arrays */
      return copy(encoded, encoded, stack, decode);
    }

    throw new TypeError("Error decoding " + type + ": " + JSON.stringify(encoded));
  }
45560
function encode(data) {
  var encodedData = null;
  try {
    encodedData = JSON.stringify(data);
  } catch (err) {
    logger.warn('failed encoding data', data);
  }
  return encodedData;
}