Examples of readExternal()


Examples of com.google.i18n.phonenumbers.Phonemetadata.PhoneMetadataCollection.readExternal()

   * @return        the loaded metadata protocol buffer.
   */
  private static PhoneMetadataCollection loadMetadataAndCloseInput(ObjectInputStream source) {
    PhoneMetadataCollection metadataCollection = new PhoneMetadataCollection();
    try {
      metadataCollection.readExternal(source);
    } catch (IOException e) {
      logger.log(Level.WARNING, "error reading input (ignored)", e);
    } finally {
      try {
        source.close();
View Full Code Here

Examples of com.google.i18n.phonenumbers.prefixmapper.MappingFileProvider.readExternal()

  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());
  }

  private static Map<Integer, String> parseTextFileHelper(String input) throws IOException {
View Full Code Here

Examples of com.google.i18n.phonenumbers.prefixmapper.PhonePrefixMap.readExternal()

        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

Examples of com.google.i18n.phonenumbers.prefixmapper.PrefixTimeZonesMap.readExternal()

    InputStream source = PhoneNumberToTimeZonesMapper.class.getResourceAsStream(path);
    ObjectInputStream in = null;
    PrefixTimeZonesMap map = new PrefixTimeZonesMap();
    try {
      in = new ObjectInputStream(source);
      map.readExternal(in);
    } catch (IOException e) {
      LOGGER.log(Level.WARNING, e.toString());
    } finally {
      close(in);
    }
View Full Code Here

Examples of de.kunysch.localimdb.Movie.readExternal()

      movieA2.writeExternal(out);
      movieB.writeExternal(out);
      out.close();
      final ObjectInput in = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()));
      final Movie readMovie = new Movie();
      readMovie.readExternal(in);
      assertEquals(movieDefault, readMovie);
      readMovie.readExternal(in);
      assertEquals(movieA, readMovie);
      readMovie.readExternal(in);
      assertEquals(movieA2, readMovie);
View Full Code Here

Examples of de.kunysch.localimdb.Movies.readExternal()

      moviesNowG1.writeExternal(out);
      moviesNowG1H123.writeExternal(out);
      out.close();
      final ObjectInput in = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()));
      final Movies readMovies = new Movies();
      readMovies.readExternal(in);
      readMovies.readExternal(in);
      readMovies.readExternal(in);
      assertFalse(readMovies.isEmpty());
      assertEquals(timestamp, readMovies.getTimestamp());
      assertEquals(1, readMovies.findByTitle(titleG).length);
View Full Code Here

Examples of de.lmu.ifi.dbs.elki.index.tree.spatial.SpatialDirectoryEntry.readExternal()

    }
    else {
      entries = (E[]) new SpatialDirectoryEntry[capacity];
      for(int i = 0; i < numEntries; i++) {
        SpatialDirectoryEntry s = new SpatialDirectoryEntry();
        s.readExternal(in);
        entries[i] = (E) s;
      }
    }
  }
}
View Full Code Here

Examples of de.lmu.ifi.dbs.elki.index.tree.spatial.SpatialPointLeafEntry.readExternal()

    final int capacity = in.readInt();
    if(isLeaf()) {
      entries = (E[]) new SpatialPointLeafEntry[capacity];
      for(int i = 0; i < numEntries; i++) {
        SpatialPointLeafEntry s = new SpatialPointLeafEntry();
        s.readExternal(in);
        entries[i] = (E) s;
      }
    }
    else {
      entries = (E[]) new SpatialDirectoryEntry[capacity];
View Full Code Here

Examples of java.awt.datatransfer.DataFlavor.readExternal()

        f.writeExternal(oos);
        ByteArrayInputStream bais =
          new ByteArrayInputStream(baos.toByteArray());
        ObjectInputStream ois = new ObjectInputStream(bais);
        DataFlavor read = new DataFlavor();
        read.readExternal(ois);
        assertEquals(f.getPrimaryType(), read.getPrimaryType());
        assertEquals(f.getSubType(), read.getSubType());
        assertEquals(f.getRepresentationClass(),
                     read.getRepresentationClass());
        assertEquals(f.getHumanPresentableName(),
View Full Code Here

Examples of java.io.Externalizable.readExternal()

                {

          Externalizable exColumn = (Externalizable) neColumn;

          inUserCode = true;
          exColumn.readExternal(logicalDataIn);
          inUserCode = false;

          arrayPosition++;
          continue;
        }
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.