Exemplo n.º 1
0
 public void readBytes(InputStream rawConfig) throws DataFormatException, IOException {
   _destination = Destination.create(rawConfig);
   _options = DataHelper.readProperties(rawConfig);
   _creationDate = DataHelper.readDate(rawConfig);
   _signature = new Signature();
   _signature.readBytes(rawConfig);
 }
Exemplo n.º 2
0
 /**
  * As of 0.9.3, expiration MUST be all zeros as it is ignored on readin and the signature will
  * fail. Restored as of 0.9.12, wait several more releases before using.
  *
  * @throws IllegalStateException if was already read in
  */
 public void readBytes(InputStream in) throws DataFormatException, IOException {
   if (_transportStyle != null) throw new IllegalStateException();
   _cost = (short) DataHelper.readLong(in, 1);
   _expiration = DataHelper.readLong(in, 8);
   _transportStyle = DataHelper.readString(in);
   // reduce Object proliferation
   if (_transportStyle.equals("SSU")) _transportStyle = "SSU";
   else if (_transportStyle.equals("NTCP")) _transportStyle = "NTCP";
   DataHelper.readProperties(in, _options);
 }