Examples of PhonePrefixMap


Examples of com.google.i18n.phonenumbers.prefixmapper.PhonePrefixMap

   */
  // @VisibleForTesting
  static void writeToBinaryFile(SortedMap<Integer, String> sortedMap, OutputStream output)
      throws IOException {
    // Build the corresponding phone prefix map and serialize it to the binary format.
    PhonePrefixMap phonePrefixMap = new PhonePrefixMap();
    phonePrefixMap.readPhonePrefixMap(sortedMap);
    ObjectOutputStream objectOutputStream = new ObjectOutputStream(output);
    phonePrefixMap.writeExternal(objectOutputStream);
    objectOutputStream.flush();
  }
View Full Code Here

Examples of com.google.i18n.phonenumbers.prefixmapper.PhonePrefixMap

    SortedMap<Integer, String> phonePrefixMappings =
        GeneratePhonePrefixData.readMappingsFromTextFile(byteArrayInputStream);
    GeneratePhonePrefixData.writeToBinaryFile(phonePrefixMappings, byteArrayOutputStream);
    // The byte array output stream now contains the corresponding serialized phone prefix map. Try
    // to deserialize it and compare it with the initial input.
    PhonePrefixMap phonePrefixMap = new PhonePrefixMap();
    phonePrefixMap.readExternal(
        new ObjectInputStream(new ByteArrayInputStream(byteArrayOutputStream.toByteArray())));

    return phonePrefixMap.toString();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.