All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.thorbenkuck.network.connection.DataConnection Maven / Gradle / Ivy

There is a newer version: 0.4.0
Show newest version
package com.github.thorbenkuck.network.connection;

import java.io.IOException;
import java.net.Socket;
import java.nio.channels.SocketChannel;

public interface DataConnection {

	static DataConnection wrap(Socket socket) throws IOException {
		return new SocketConnection(socket);
	}

	static DataConnection wrap(SocketChannel channel) throws IOException {
		return new SocketChannelDataConnection(channel);
	}

	byte[] read(int i) throws IOException;

	void write(byte[] data) throws IOException;

	void flush() throws IOException;

	void close() throws IOException;

	void closeSilent();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy