is Valid Udp Or Tcp Port - Android java.net

Android examples for java.net:IP Address

Description

is Valid Udp Or Tcp Port

Demo Code

import android.system.OsConstants;
import android.system.OsConstants;
import java.net.Inet6Address;
import java.net.InetAddress;
import java.nio.BufferOverflowException;
import java.nio.BufferUnderflowException;
import java.nio.ByteBuffer;
import java.nio.ShortBuffer;

public class Main{

    public static boolean isValidUdpOrTcpPort(int port) {
        return port > 0 && port < 65536;
    }//ww w .  ja  v a 2s  .  c  o m

}

Related Tutorials