Package com.google.i18n.phonenumbers.prefixmapper

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


   * Outputs the binary configuration file mapping country codes to language strings.
   */
  // @VisibleForTesting
  static void outputBinaryConfiguration(SortedMap<Integer, Set<String>> availableDataFiles,
                                        OutputStream outputStream) throws IOException {
    MappingFileProvider mappingFileProvider = new MappingFileProvider();
    mappingFileProvider.readFileConfigs(availableDataFiles);
    ObjectOutputStream objectOutputStream = new ObjectOutputStream(outputStream);
    mappingFileProvider.writeExternal(objectOutputStream);
    objectOutputStream.flush();
  }
View Full Code Here


  }

  public void testOutputBinaryConfiguration() throws IOException {
    ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
    GeneratePhonePrefixData.outputBinaryConfiguration(AVAILABLE_DATA_FILES, byteArrayOutputStream);
    MappingFileProvider mappingFileProvider = new MappingFileProvider();
    mappingFileProvider.readExternal(
        new ObjectInputStream(new ByteArrayInputStream(byteArrayOutputStream.toByteArray())));
    assertEquals("1|en,en_US,es,\n33|en,fr,\n86|zh_Hans,\n", mappingFileProvider.toString());
  }
View Full Code Here

TOP

Related Classes of com.google.i18n.phonenumbers.prefixmapper.MappingFileProvider

Copyright © 2018 www.massapicom. 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.