Package be.bagofwords.util

Examples of be.bagofwords.util.WrappedSocketConnection.writeByte()


    @Override
    public InputStream createInputStream() {
        try {
            WrappedSocketConnection connection = new WrappedSocketConnection(host, port);
            connection.writeByte((byte) RemoteFileServer.Action.INPUT_STREAM.ordinal());
            connection.writeString(relPath.getPath());
            connection.flush();
            long answer = connection.readLong();
            if (answer == BaseServer.LONG_OK) {
                return connection.getIs();
View Full Code Here


    @Override
    public OutputStream createOutputStream() {
        try {
            WrappedSocketConnection connection = new WrappedSocketConnection(host, 1220);
            connection.writeByte((byte) RemoteFileServer.Action.OUTPUT_STREAM.ordinal());
            connection.writeString(relPath.getPath());
            connection.flush();
            long answer = connection.readLong();
            if (answer == BaseServer.LONG_OK) {
                return connection.getOs();
View Full Code Here

    @Override
    public boolean exists() {
        WrappedSocketConnection connection = null;
        try {
            connection = new WrappedSocketConnection(host, 1220);
            connection.writeByte((byte) RemoteFileServer.Action.EXISTS.ordinal());
            connection.writeString(relPath.getPath());
            connection.flush();
            return connection.readBoolean();
        } catch (IOException exp) {
            throw new RuntimeException("Received exception while querying exists to " + host + ":" + port, exp);
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.