@Override protected void doReadMessage(InputStream in, int size) throws I2CPMessageException, IOException { SessionId id = new SessionId(); try { id.readBytes(in); } catch (DataFormatException dfe) { throw new I2CPMessageException("Unable to load the message data", dfe); } setSessionId(id); }
@Override protected void doReadMessage(InputStream in, int size) throws I2CPMessageException, IOException { try { _sessionId = new SessionId(); _sessionId.readBytes(in); _status = (int) DataHelper.readLong(in, 1); } catch (DataFormatException dfe) { throw new I2CPMessageException("Unable to load the message data", dfe); } }
@Override protected void doReadMessage(InputStream in, int size) throws I2CPMessageException, IOException { try { if (_sessionId != null) throw new IllegalStateException(); _sessionId = new SessionId(); _sessionId.readBytes(in); int numTunnels = (int) DataHelper.readLong(in, 1); for (int i = 0; i < numTunnels; i++) { Lease lease = new Lease(); lease.readBytes(in); _endpoints.add(lease); } } catch (DataFormatException dfe) { throw new I2CPMessageException("Unable to load the message data", dfe); } }
@Override protected void doReadMessage(InputStream in, int size) throws I2CPMessageException, IOException { try { _sessionId = new SessionId(); _sessionId.readBytes(in); _sessionConfig = new SessionConfig(); _sessionConfig.readBytes(in); } catch (DataFormatException dfe) { throw new I2CPMessageException("Unable to load the message data", dfe); } }
protected void doReadMessage(InputStream in, int size) throws I2CPMessageException, IOException { try { _sessionId = new SessionId(); _sessionId.readBytes(in); _reqID = DataHelper.readLong(in, 4); _code = (int) DataHelper.readLong(in, 1); if (_code == RESULT_SUCCESS) _dest = Destination.create(in); } catch (DataFormatException dfe) { throw new I2CPMessageException("bad data", dfe); } }
/** * Read the body into the data structures * * @throws IOException */ @Override public void readMessage(InputStream in, int length, int type) throws I2CPMessageException, IOException { if (type != getType()) throw new I2CPMessageException("Invalid message type (found: " + type + " supported: " + getType() + " class: " + getClass().getName() + ")"); if (length < 0) throw new IOException("Negative payload size"); try { _sessionId = new SessionId(); _sessionId.readBytes(in); _destination = Destination.create(in); _payload = new Payload(); _payload.readBytes(in); _nonce = DataHelper.readLong(in, 4); } catch (DataFormatException dfe) { throw new I2CPMessageException("Unable to load the message data", dfe); } }
@Override protected void doReadMessage(InputStream in, int size) throws I2CPMessageException, IOException { try { _sessionId = new SessionId(); _sessionId.readBytes(in); int numTunnels = (int) DataHelper.readLong(in, 1); _endpoints.clear(); for (int i = 0; i < numTunnels; i++) { //Hash router = new Hash(); //router.readBytes(in); Hash router = Hash.create(in); TunnelId tunnel = new TunnelId(); tunnel.readBytes(in); _endpoints.add(new TunnelEndpoint(router, tunnel)); } _end = DataHelper.readDate(in); } catch (DataFormatException dfe) { throw new I2CPMessageException("Unable to load the message data", dfe); } }
protected void doReadMessage(InputStream in, int size) throws I2CPMessageException, IOException { try { _sessionId = new SessionId(); _sessionId.readBytes(in); _reqID = DataHelper.readLong(in, 4); _timeout = DataHelper.readLong(in, 4); _lookupType = (int) DataHelper.readLong(in, 1); if (_lookupType == LOOKUP_HASH) { _hash = Hash.create(in); } else if (_lookupType == LOOKUP_HOST) { _host = DataHelper.readString(in); if (_host.length() == 0) throw new I2CPMessageException("bad host"); } else { throw new I2CPMessageException("bad type"); } } catch (DataFormatException dfe) { throw new I2CPMessageException("bad data", dfe); } }
@Override protected void doReadMessage(InputStream in, int size) throws I2CPMessageException, IOException { try { _sessionId = new SessionId(); _sessionId.readBytes(in); _severity = new AbuseSeverity(); _severity.readBytes(in); _reason = new AbuseReason(); _reason.readBytes(in); _messageId = new MessageId(); _messageId.readBytes(in); } catch (DataFormatException dfe) { throw new I2CPMessageException("Unable to load the message data", dfe); } }
@Override protected void doReadMessage(InputStream in, int size) throws I2CPMessageException, IOException { try { _sessionId = new SessionId(); _sessionId.readBytes(in); // Revocation is unimplemented. // As the SPK comes before the LeaseSet, we don't know the key type. // We could have some sort of callback or state setting so we get the // expected type from the session. But for now, we just assume it's 20 bytes. // Clients outside router context should throw in a dummy 20 bytes. _signingPrivateKey = new SigningPrivateKey(); _signingPrivateKey.readBytes(in); _privateKey = new PrivateKey(); _privateKey.readBytes(in); _leaseSet = new LeaseSet(); _leaseSet.readBytes(in); } catch (DataFormatException dfe) { throw new I2CPMessageException("Error reading the CreateLeaseSetMessage", dfe); } }
try { _sessionId = new SessionId(); _sessionId.readBytes(in); int type = in.read(); if (type == DatabaseEntry.KEY_TYPE_LEASESET) {