Package com.sshtools.j2ssh.transport

Examples of com.sshtools.j2ssh.transport.InvalidMessageException


                for (int i = 0; i < responses.length; i++) {
                    baw.writeString(responses[i]);
                }
            }
        } catch (IOException ioe) {
            throw new InvalidMessageException("Failed to write message data");
        }
    }
View Full Code Here


                for (int i = 0; i < responses.length; i++) {
                    responses[i] = bar.readString();
                }
            }
        } catch (IOException ioe) {
            throw new InvalidMessageException("Failed to read message data");
        }
    }
View Full Code Here

            if (bar.available() > 0) {
                type = bar.read();
                constructMessage(bar);
            } else {
                throw new InvalidMessageException(
                    "Not enough message data to complete the message");
            }
        } catch (IOException ioe) {
            throw new InvalidMessageException(
                "The message data cannot be read!");
        }
    }
View Full Code Here

            baw.write(type);
            constructByteArray(baw);

            return baw.toByteArray();
        } catch (IOException ioe) {
            throw new InvalidMessageException(
                "The message data cannot be written!");
        }
    }
View Full Code Here

        try {
            //baw.write(ok ? 1 : 0);
            baw.writeString(algorithm);
            baw.writeBinaryString(key);
        } catch (IOException ioe) {
            throw new InvalidMessageException("Failed to write message data!");
        }
    }
View Full Code Here

        try {
            //ok = ((bar.read() == 1) ? true : false);
            algorithm = bar.readString();
            key = bar.readBinaryString();
        } catch (IOException ioe) {
            throw new InvalidMessageException("Failed to read message data!");
        }
    }
View Full Code Here

        throws InvalidMessageException {
        try {
            Class impl = (Class) registeredMessages.get(new Integer(msgdata[0]));

            if (impl == null) {
                throw new InvalidMessageException("The message with id " +
                    String.valueOf(msgdata[0]) + " is not implemented");
            }

            SubsystemMessage msg = (SubsystemMessage) impl.newInstance();
            msg.fromByteArray(msgdata);
            addMessage(msg);

            return;
        } catch (IllegalAccessException iae) {
        } catch (InstantiationException ie) {
        }

        throw new InvalidMessageException("Could not instantiate message class");
    }
View Full Code Here

        throws java.io.IOException,
            com.sshtools.j2ssh.transport.InvalidMessageException {
        try {
            baw.write(padding);
        } catch (IOException ioe) {
            throw new InvalidMessageException(ioe.getMessage());
        }
    }
View Full Code Here

            com.sshtools.j2ssh.transport.InvalidMessageException {
        try {
            padding = new byte[bar.available()];
            bar.read(padding);
        } catch (IOException ioe) {
            throw new InvalidMessageException(ioe.getMessage());
        }
    }
View Full Code Here

        throws java.io.IOException,
            com.sshtools.j2ssh.transport.InvalidMessageException {
        try {
            baw.writeString(password);
        } catch (IOException ioe) {
            throw new InvalidMessageException(ioe.getMessage());
        }
    }
View Full Code Here

TOP

Related Classes of com.sshtools.j2ssh.transport.InvalidMessageException

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.