public override void readExternal(ObjectInput objectInput)
        {
            // Read binary words sizes.
            prefixSizeInBytes = objectInput.readInt();
            descIndexSizeInBytes = objectInput.readInt();

            // Read possible lengths.
            int sizeOfLengths = objectInput.readInt();
            possibleLengths.clear();
            for (int i = 0; i < sizeOfLengths; i++) {
              possibleLengths.add(objectInput.readInt());
            }

            // Read description pool size.
            int descriptionPoolSize = objectInput.readInt();
            // Read description pool.
            if (descriptionPool == null || descriptionPool.Length < descriptionPoolSize) {
              descriptionPool = new String[descriptionPoolSize];
            }
            for (int i = 0; i < descriptionPoolSize; i++) {
              String description = objectInput.readUTF();
              descriptionPool[i] = description;
            }
            readEntries(objectInput);
        }
 /**
    * Supports Java Serialization.
    */
 public override void readExternal(ObjectInput objectInput)
 {
     // Read the area code map storage strategy flag.
     boolean useFlyweightMapStorage = objectInput.readBoolean();
     if (useFlyweightMapStorage) {
       areaCodeMapStorage = new FlyweightMapStorage();
     } else {
       areaCodeMapStorage = new DefaultMapStorage();
     }
     areaCodeMapStorage.readExternal(objectInput);
 }
 public override void readExternal(ObjectInput objectInput)
 {
     numOfEntries = objectInput.readInt();
     if (phoneNumberPrefixes == null || phoneNumberPrefixes.Length < numOfEntries) {
       phoneNumberPrefixes = new int[numOfEntries];
     }
     if (descriptions == null || descriptions.Length < numOfEntries) {
       descriptions = new String[numOfEntries];
     }
     for (int i = 0; i < numOfEntries; i++) {
       phoneNumberPrefixes[i] = objectInput.readInt();
       descriptions[i] = objectInput.readUTF();
     }
     int sizeOfLengths = objectInput.readInt();
     possibleLengths.clear();
     for (int i = 0; i < sizeOfLengths; i++) {
       possibleLengths.add(objectInput.readInt());
     }
 }
 /**
    * Supports Java Serialization.
    */
 public override void readExternal(ObjectInput objectInput)
 {
     numOfEntries = objectInput.readInt();
     if (countryCallingCodes == null || countryCallingCodes.Length < numOfEntries) {
       countryCallingCodes = new int[numOfEntries];
     }
     if (availableLanguages == null) {
       availableLanguages = new ArrayList<Set<String>>();
     }
     for (int i = 0; i < numOfEntries; i++) {
       countryCallingCodes[i] = objectInput.readInt();
       int numOfLangs = objectInput.readInt();
       Set<String> setOfLangs = new HashSet<String>();
       for (int j = 0; j < numOfLangs; j++) {
     setOfLangs.add(objectInput.readUTF());
       }
       availableLanguages.add(setOfLangs);
     }
 }
Esempio n. 5
0
		public ObjectInputStream (ObjectInput stream)
		{
			_javaObjectInput = stream;
		}
   /**
      * Stores a value which is read from the provided {@code objectInput} to the provided byte {@code
      * buffer} at the specified {@code index}.
      *
      * @param objectInput  the object input stream from which the value is read
      * @param wordSize  the number of bytes used to store the value read from the stream
      * @param outputBuffer  the byte buffer to which the value is stored
      * @param index  the index where the value is stored in the buffer
      * @throws IOException  if an error occurred reading from the object input stream
      */
   private static void readExternalWord(ObjectInput objectInput, int wordSize,
 ByteBuffer outputBuffer, int index)
   {
       int wordIndex = index * wordSize;
       if (wordSize == SHORT_NUM_BYTES) {
         outputBuffer.putShort(wordIndex, objectInput.readShort());
       } else {
         outputBuffer.putInt(wordIndex, objectInput.readInt());
       }
   }
 /**
    * Reads the area code entries from the provided input stream and stores them to the internal byte
    * buffers.
    */
 private void readEntries(ObjectInput objectInput)
 {
     numOfEntries = objectInput.readInt();
     if (phoneNumberPrefixes == null || phoneNumberPrefixes.capacity() < numOfEntries) {
       phoneNumberPrefixes = ByteBuffer.allocate(numOfEntries * prefixSizeInBytes);
     }
     if (descriptionIndexes == null || descriptionIndexes.capacity() < numOfEntries) {
       descriptionIndexes = ByteBuffer.allocate(numOfEntries * descIndexSizeInBytes);
     }
     for (int i = 0; i < numOfEntries; i++) {
       readExternalWord(objectInput, prefixSizeInBytes, phoneNumberPrefixes, i);
       readExternalWord(objectInput, descIndexSizeInBytes, descriptionIndexes, i);
     }
 }
            public override void readExternal(ObjectInput objectInput)
            {
                boolean hasDesc = objectInput.readBoolean();
                  if (hasDesc) {
                PhoneNumberDesc desc = new PhoneNumberDesc();
                desc.readExternal(objectInput);
                setGeneralDesc(desc);
                  }
                  hasDesc = objectInput.readBoolean();
                  if (hasDesc) {
                PhoneNumberDesc desc = new PhoneNumberDesc();
                desc.readExternal(objectInput);
                setFixedLine(desc);
                  }
                  hasDesc = objectInput.readBoolean();
                  if (hasDesc) {
                PhoneNumberDesc desc = new PhoneNumberDesc();
                desc.readExternal(objectInput);
                setMobile(desc);
                  }
                  hasDesc = objectInput.readBoolean();
                  if (hasDesc) {
                PhoneNumberDesc desc = new PhoneNumberDesc();
                desc.readExternal(objectInput);
                setTollFree(desc);
                  }
                  hasDesc = objectInput.readBoolean();
                  if (hasDesc) {
                PhoneNumberDesc desc = new PhoneNumberDesc();
                desc.readExternal(objectInput);
                setPremiumRate(desc);
                  }
                  hasDesc = objectInput.readBoolean();
                  if (hasDesc) {
                PhoneNumberDesc desc = new PhoneNumberDesc();
                desc.readExternal(objectInput);
                setSharedCost(desc);
                  }
                  hasDesc = objectInput.readBoolean();
                  if (hasDesc) {
                PhoneNumberDesc desc = new PhoneNumberDesc();
                desc.readExternal(objectInput);
                setPersonalNumber(desc);
                  }
                  hasDesc = objectInput.readBoolean();
                  if (hasDesc) {
                PhoneNumberDesc desc = new PhoneNumberDesc();
                desc.readExternal(objectInput);
                setVoip(desc);
                  }
                  hasDesc = objectInput.readBoolean();
                  if (hasDesc) {
                PhoneNumberDesc desc = new PhoneNumberDesc();
                desc.readExternal(objectInput);
                setPager(desc);
                  }
                  hasDesc = objectInput.readBoolean();
                  if (hasDesc) {
                PhoneNumberDesc desc = new PhoneNumberDesc();
                desc.readExternal(objectInput);
                setUan(desc);
                  }
                  hasDesc = objectInput.readBoolean();
                  if (hasDesc) {
                PhoneNumberDesc desc = new PhoneNumberDesc();
                desc.readExternal(objectInput);
                setEmergency(desc);
                  }
                  hasDesc = objectInput.readBoolean();
                  if (hasDesc) {
                PhoneNumberDesc desc = new PhoneNumberDesc();
                desc.readExternal(objectInput);
                setVoicemail(desc);
                  }
                  hasDesc = objectInput.readBoolean();
                  if (hasDesc) {
                PhoneNumberDesc desc = new PhoneNumberDesc();
                desc.readExternal(objectInput);
                setShortCode(desc);
                  }
                  hasDesc = objectInput.readBoolean();
                  if (hasDesc) {
                PhoneNumberDesc desc = new PhoneNumberDesc();
                desc.readExternal(objectInput);
                setStandardRate(desc);
                  }
                  hasDesc = objectInput.readBoolean();
                  if (hasDesc) {
                PhoneNumberDesc desc = new PhoneNumberDesc();
                desc.readExternal(objectInput);
                setCarrierSpecific(desc);
                  }
                  hasDesc = objectInput.readBoolean();
                  if (hasDesc) {
                PhoneNumberDesc desc = new PhoneNumberDesc();
                desc.readExternal(objectInput);
                setNoInternationalDialling(desc);
                  }

                  setId(objectInput.readUTF());
                  setCountryCode(objectInput.readInt());
                  setInternationalPrefix(objectInput.readUTF());

                  boolean hasString = objectInput.readBoolean();
                  if (hasString) {
                setPreferredInternationalPrefix(objectInput.readUTF());
                  }

                  hasString = objectInput.readBoolean();
                  if (hasString) {
                setNationalPrefix(objectInput.readUTF());
                  }

                  hasString = objectInput.readBoolean();
                  if (hasString) {
                setPreferredExtnPrefix(objectInput.readUTF());
                  }

                  hasString = objectInput.readBoolean();
                  if (hasString) {
                setNationalPrefixForParsing(objectInput.readUTF());
                  }

                  hasString = objectInput.readBoolean();
                  if (hasString) {
                setNationalPrefixTransformRule(objectInput.readUTF());
                  }

                  setSameMobileAndFixedLinePattern(objectInput.readBoolean());

                  int nationalFormatSize = objectInput.readInt();
                  for (int i = 0; i < nationalFormatSize; i++) {
                NumberFormat numFormat = new NumberFormat();
                numFormat.readExternal(objectInput);
                numberFormat_.add(numFormat);
                  }

                  int intlNumberFormatSize = objectInput.readInt();
                  for (int i = 0; i < intlNumberFormatSize; i++) {
                NumberFormat numFormat = new NumberFormat();
                numFormat.readExternal(objectInput);
                intlNumberFormat_.add(numFormat);
                  }

                  setMainCountryForCode(objectInput.readBoolean());

                  hasString = objectInput.readBoolean();
                  if (hasString) {
                setLeadingDigits(objectInput.readUTF());
                  }

                  setLeadingZeroPossible(objectInput.readBoolean());
            }
 public override void readExternal(ObjectInput objectInput)
 {
     setPattern(objectInput.readUTF());
       setFormat(objectInput.readUTF());
       int leadingDigitsPatternSize = objectInput.readInt();
       for (int i = 0; i < leadingDigitsPatternSize; i++) {
     leadingDigitsPattern_.add(objectInput.readUTF());
       }
       if (objectInput.readBoolean()) {
     setNationalPrefixFormattingRule(objectInput.readUTF());
       }
       if (objectInput.readBoolean()) {
     setDomesticCarrierCodeFormattingRule(objectInput.readUTF());
       }
       setNationalPrefixOptionalWhenFormatting(objectInput.readBoolean());
 }
            public override void readExternal(ObjectInput objectInput)
            {
                if (objectInput.readBoolean()) {
                setNationalNumberPattern(objectInput.readUTF());
                  }

                  if (objectInput.readBoolean()) {
                setPossibleNumberPattern(objectInput.readUTF());
                  }

                  if (objectInput.readBoolean()) {
                setExampleNumber(objectInput.readUTF());
                  }
            }
 public override void readExternal(ObjectInput objectInput)
 {
     int size = objectInput.readInt();
       for (int i = 0; i < size; i++) {
     PhoneMetadata metadata = new PhoneMetadata();
     metadata.readExternal(objectInput);
     metadata_.add(metadata);
       }
 }
Esempio n. 12
0
		/// <summary>
		/// Restores this <code>DataFlavor</code> from a Serialized state.
		/// </summary>
		public void readExternal(ObjectInput @is)
		{
		}