切换
21文档网
类库大全
IT社区
开源文档
示例代码
速查表
在线工具
语言基础
网络
网络
异步服务器
Managing Asynchronous Communication Server
Managing asynchronous communication using the AsynchronousServerSocketChannel class
Writing to a file using the AsynchronousFileChannel class
Understanding the AsynchronousServerSocketChannel class options
Using the Future object in a server with Asynchronous Communication Server
Reading from a file using the AsynchronousFileChannel class
Blocks until the write operation has completed in AsynchronousFileChannel
Cookie
implement CookiePolicy
implements CookieStore, Runnable
Getting the Cookies from an HTTP Connection
Sending a Cookie to an HTTP Server
Extracts a cookie value from a list of cookies based on the name.
Returns the date format used for expiry times in type zero (Netscape) cookies.
数据通道
An Echo Server Based on the Datagram Channel
A Client Program Based on the Datagram Channel
A DatagramChannel-Based Multicast Client Program
A DatagramChannel-Based Multicast Program That Sends a Message to a Multicast Group
Broadcasting to a Group of Recipients
Time-service client using DatagramChannel
DatagramChannel time server, Provide RFC 868 time service (http://www.ietf.org/rfc/rfc0868.txt)
电子邮件
Sending an E-Mail
Attaching Files to an E-Mail Message
Sending an HTML E-Mail
Sending E-Mail to a Group of Recipients
Checking E-Mail
Monitoring an E-Mail Account
The Program to Send E-Mail [J2EE]
Create and send email
add Charset to mail ContentType
remove Charset from mail ContentType
send An Email
validate Email via InternetAddress
Utility method to send email with attachment
Utility method to send simple HTML email
send Email Format Html
send Email File Byte
send Email File Path
send Email Format Plain
send Email
send Email and set up the session
send Mail Auth
send Mail Auth SSL
send Mail via MimeMessage
send Mail No Auth
send Mail No Auth SSL
send Email, creates a new session with an authenticator
get EMail Session
send Email via Message
send Email via Authenticator
send Text Message
Utility method to send image in email body
Send email to a recipient
Send email with attachment to gmail
Login to email server with smtp
Send email with SMTPAuthenticator
Use MimeMultipart to send email
Send HTML format email
Send email to gmail with SSL
主机
get Host Name
get Computer Name from Host
get Local Host Name
get All Local Host Names
Gets the host name of this system.
local Canonical Host Name
Returns all network interfaces of this host.
compare two host name to check if they are the same host without DNS resolving.
Gets all the ip address from the name service;
Http
Developing a Concise HTTP Client
Making HTTP Requests and Working with HTTP Responses
Getting the Response Headers from an HTTP Connection
Preventing Automatic Redirects in a HTTP Connection
is content Type Binary
HTTP send Get
HTTP send Post
get HTTP Code Message
do Send to Socket server
create Host Name Verifier
create SSL Context
make Saaj Request SOAPMessage
Used to send a specific message as a POST request to an endpoint.
Parses a JSON object into a map of links.
Get SSL Context
get Https URL Connection
get Http URL Connection
Creates a new java.net.URLConnection object from the specified java.net.URL.
get Cookie from HttpServletRequest
do Http Post
do Https Get
get App Host Name from HttpServletRequest
validate URL by connecting to it
Copied from URLDecoder.java
is Host Port Available
Returns the hostname of the local host.
open Link vis default browser
get Content Type from return File Name
is HTTP Response Code Retryable
get Page by encoding
Download from HTTP return InputStream
Parse out a charset from a content type header.
binary Sid To String Sid
string Sid To Byte Array Sid
fetch HTTP Data
Extracts only the mime-type from a Content-Type HTTP header.
Look for the HTTP verb which should be GET , POST , PUT , DELETE , OPTIONS or HEAD .
Returns the Charset from the given content-type.
Iterates over the given acceptedContentTypes, looking for one of those values: text/html application
IP地址
Demonstrating the Use of the InetAddress Class
Representing a Socket Address
Getting the Hostname of an IP Address
Getting the IP Address and Hostname of the Local Machine
Getting the IP Address of a Hostname
Host IP Lookup Application
Converts the given bytes of an IP to a string representation.
Get IP address from NetworkInterface
get IP Address using InetAddress
get Local IP Addresses
Compute network address from IP and mask
Checks if a subnet contains a specific IP address.
Convert ip to an integer
Convert an IP address stored in an int to its string representation.
Retrieves the first non-loopback IP address, (i.e., filters out 127.0.0.1 addresses) for machine your are running on.
Convert an integer into an IPv4 INET address.
Convert an IPv4 INET address to an integer.
Returns InetAddress for passed host IF its in IPV4 quads format (e.g.
get Local Host IP
Returns an InetAddress object encapsulating what is most likely the machine's LAN IP address.
Get a mapping of all assigned IP-addresses to their according broadcast addresses
Get the IP version 4 address of the local device
Get the network mac address associated with a particular IP address
is IPv6 Hex Compressed Address
reverse Map IP Address
reverse IP Subnet Mask Domain
IP subnet Address
Constructs an InetAddress object for the IP address specified in the network-byte-order array.
Returns the IP address string "%d.%d.%d.%d" for the given IPv4 address.
Given an ip in numeric format, return a byte array that can be fed to InetAddress.
Given an ip in a numeric, string format, return the InetAddress.
Checks whether the parameter is a valid IPv6 address (including compressed).
Checks whether the parameter is a valid compressed IPv6 address
Get broadcast IP addresses.
Returns a string representation of the specified socket address in the form :
:
Creates an InetSocketAddress given a host and optional port in a single String This allows either IP
IP address (InetSocketAddress) To String
Tests whether the ip Address is within the address space defined by the ip Address With Net mask.
get Current IP Address via web service
Generate a random ipv4 address in the 10.0.0.0/8 range.
get Current Host Ip Address
is IPv4 or IPv6 Literal Address
Compare two IP address byte array, the length must be 4 or 16.
parse the IP address string as a byte array If the IP address is IPv4 address, the byte array length
convert From IPv4 Mapped IPv6 Address
is IPv4 Literal Address
Utility routine to check if the InetAddress is an IPv4 mapped IPv6 address.
is IPv6 Literal Address
text To Numeric Format IPv4
text To Numeric Format IPv6
Test to see if the given address string represents a literal IPv4 address.
get Cider Base IP
get List Of IP Address
get List Of Numeric IP Address
get IP Subnet Mask
get IP Subnet Mask Numeric
ip To Number
number To IP
Get Net Ip address
convert int ip value to dotted ip address format
A convenient method that accepts an IP address represented as a long and returns an byte array of si
check Ip Mask
get IP from SocketAddress
get Ip Address from Inet4Address
Check netmask, e.g.
Get a loopback NIF.
Find the IP address of localhost.
Find the hostname of localhost.
get Local IPs
Mac地址
get Linux MAC Address
get Unix MAC Address
get Windows MAC Address
Get the network mac address of the local device
get Random Mac Address
get Mac Address from InetAddress
get Mac Address List
get Mac Address from shell command
get MAC Number via vbs script
get Mac Address
get OS MAC Address
If running on a Mac, this method will set the system property which tells the menu bar to display at
Mime类型
get Mime Type For File
convert Extension To MIME Type
Returns a default extension for a given mime-type, or an empty string if the mimetype is unknown.
Returns the mime-type according to the given file extension.
Indicates whether a mime-type represents an document containing html or xhtml.
网络地址
get My Address as InetAddress
get My Host Name from InetAddress
parse host And Port via InetSocketAddress
Parse space delimited address [:port] string and return array of InetSocketAddress.
get InetAddress and default Charset Name
When using the java.net.InetAddress#getHostName() method in an environment where neither a proper DN
Returns a collection of all addresses which do not have a local scope (loopbacks etc).
Returns the address which is most likely the external address.
Returns true when the given address is a local address.
Returns true if the given address represents the local host.
Parses the string and returns a InetSocketAddress.
get Inet Address By List
Creates an array of InetSocketAddress given an array of String
get Byte array Of Host Address
get Host Address Of Byte array
get String Of Sub Network Address Ranges
get Sub Network Address Range
is Valid Address In Net block String
get Inet Socket Address
get Single InetSocketAddress
get Port from SocketAddress
local SocketAddress
get Private InetAddress
get Public InetAddress
merge mail Addresses
Increment subnet based on how subnets are to be divided e.g.
check if one subnet is in range of the other, useful , for dividing subnet into chunks
Replies the IPv4 loopback address.
Replies the first IPv4 public address.
Given a starting InetAddress and an ending InetAddress compute a raw subnet mask that will be used a
Given a stating InetAddress and an ending InetAddress compute an InetAddress instance that will be u
网络接口
NetworkInterface Overview
Listing the Available Network Interface on a Machine
List sub Network Interface
List Network Interface
List extended Network Interface
get Network Interface List
Selects the default network interface
RMI
Compute Pi with RMI
Ping
ping a Host
ping an Address
is IP Reachable
ping with Shell
ServerSocket
Defining a Network Connection to a Server
Create Time Server to serve time value
Create Socket server with ServerSocket
Knock Knock client and server
Create socket server with ServerSocket and send string message
Use thread to react each client request in a socket server
Accept text using ServerSocket
Receive message from ServerSocket
Read and write message from ServerSocket
Plain String UTF-8 communication on the net
Message SENDER with CRC
Creates a Public/Private Key pair using RSA
Greeting Server and client with Socket and ServerSocket
TCP server that runs on port 9090
socket server that replays the data set file and introduces small delay between each line.
套接字
Listening for Connections on the Server
Read from a Server with Socket
Client Socket based on Thread
Create Socket client
Creating a Client Socket
Creating a Non-Blocking Server Socket
Writing Text to a Socket
Reading Text from a Socket
Detecting When a Non-Blocking Socket Is Closed by the Remote Host
Sending a POST Request Using a Socket
Create socket client with Socket
Validates a port value if it is in range ( 1 - 65535 )
Method for getting a server data via Socket
get Server Status using Socket
Checks to see if a specific Socket port is available.
find Free Port
Read from Socket
Simple File Socket Client
Read message from server
Read html file from web
套接字通道
Creating a New Server Socket Channel
Writing a Blocking TCP Client with SocketChannel
Create a Server with ServerSocketChannel
Writing Socket Client SocketChannel
Accepts multiple clients at the same time with asynchronous server socket channel
Writing an Asynchronous Client Based on Future
Writing an Asynchronous Server Based on CompletionHandler
Writing an Asynchronous Client (Based on CompletionHandler)
A Non-Blocking Socket Channel Echo Server Program
A Non-Blocking Socket Channel Echo Client Program
A Server Application That Uses Asynchronous Server Socket Channel
An Asynchronous Client Socket Channel
Create a nonblocking server socket channel with ServerSocketChannel
A nonblocking accept( ) with ServerSocketChannel
Demonstrate asynchronous connection of a SocketChannel.
Using select( ) to service multiple channels
Servicing channels with a thread pool
Using a Selector to Manage Non-Blocking Server Sockets
Using a Selector to Manage Non-Blocking Sockets
Creating a Non-Blocking Socket
Writing to a SocketChannel
Echo Client via SocketChannel
HTTP get via SocketChannel
Echo Server via ServerSocketChannel
SSL
Creating an SSL Client Socket
Creating an SSL Server Socket
Retrieving the Certification Path of an SSL Server
Use SSLSocketFactory and SSLSocket to create an echo client
Using the ExtendedSSLSession interface
create SSL Hostname Verifier
setup SSL Connection
ignore Https Certs
config SSL Socket Factory
get SSLSocektFactory
get Ssl Socket Factory
get SSL HTTP Connection
get Supported Ciphers
Creates a promiscuous HostnameVerifier that accepts all host names without further verification.
create Delete via SSL Connection
TCP
An Echo Server Based on TCP Sockets
An Echo Client Based on TCP Sockets
Creating a Socket Connection and Sending Serializable Objects Across the Wire
Sniffs the network connection
Transfer text using Socket, tcp client
Using Thread to handle Socket client
Using Thread to handle Socket Server
UDP
Writing a UDP Server
Writing a Connectionless UDP Client
Writing a Connected UDP Client
Writing a UDP Multicast Server with DatagramChannel
Writing a UDP Multicast Client with DatagramChannel
An Echo Server Based on UDP Sockets
An Echo Client Based on UDP Sockets
A UDP Multicast Socket That Receives UDP Multicast Messages
A UDP Datagram Socket, a Multicast Sender Application
Create MulticastSocket
Create DatagramSocket Server
Create DatagramSocket client
Create DatagramSocket server to serve a text file
Sending a Datagram
Receiving a Datagram
UDP Sends a request to the host:port and returns the response.
UDP Send article data gram packet to given host.
UDP send object
UDP send Packet
Create UDP Client
Create UDP Server
Create UDP Client and Server
Create Multicast Receiver using MulticastSocket
Create Multicast Sender using DatagramSocket
Plain String UTF-8 communication using DataOutputStream
URI
How to use the URI class in a Java program.
Encodes a String using the set of characters allowed in a URI.
URL
A Sample Class That Demonstrates the Use of the java.net.URL Class
Accessing the Contents of a URL
A URL Reader/Writer Class That Writes/Reads Data to/from a URL
Generating and Reading from URLs
Parsing a URL using the built-in URL class methods.
Load Web Page Content Header And Fill the text field
Web Page Read Quiz
Call to a Servlet and output result
Read content string from a URL
Read from URL Connection
Read from URL
Using a URL as a Name to the Initial Context
Parsing a URL
Making the Browser Visit a URL
Getting an Image from a URL
Converting Between a URL and a URI
Getting Text from a URL
Accessing a Password-Protected URL
Sending a POST Request Using a URL
Reading an Image from a File, InputStream, or URL
Creating a URL
Converting Between a Filename Path and a URL
Converting x-www-form-urlencoded Data
url Decode with URLDecoder
url Encode with URLEncoder
get Result from url
Get Twitter username from twitter url
load File from URL and return InputStream
Get the Google+ ID from a plus.google.com url https://plus.google.com/118064008740771173119
Extract a map from a URL query string.
Decode given URL Query String to map.
Whole HTTP response as String from given URLConnection
read URL File
Returns the file extension from the file part of the URL.
download File from URL
Given a java.util.Map of params, construct a query string
url Decode
execute URL Post
post JSON to URL
is Local URI
Make a relative copy of a URI.
Creates a new URI from a string.
Converts a string into something you can safely insert into a URL.
Reads data from the data reader and posts it to a server via POST request.
This method encodes the URL, removes the spaces and brackets from the URL and replaces the same with
This method encodes the URL, removes the spaces from the URL and replaces the same with "%20".
get Url from text using regex
encode URL in your own algorithm
decode URL with your own algorithm
Takes a normal string and turns it into something suitable for a title in a URL.
get Domain From Url
get Last Modified from URL
remove Anchor from URL
Convert to relative url based on base
Build a fully qualified URL from the pieces provided.
Executes an HTTP-GET request and stores locally down to a file the content of the answer
URL下载
download URL and return String
download Url To File
download Video
download from URL and set connection property
download Http URL and get file name
download from Https
get Remote File Size via URL
get BufferedReader from file URL
retrieve Last Modified From URL
call Url
get Stream From URL
get From URL
retrieve a web page using the URL package, instead of raw socket
Get cookie from http via HttpURLConnection
Get Cookies From http Connection
extract URLs from HTML files
Whois Query
Create Json object and post to URL
Read from URLConnection
Get URL properties
Convert Byte Array To InputStream
UDP Time Client
Echo Client based on channel Selector
Read json string from url and create Json object
用户代理
get Random User Agent
Returns a random mobile browser user agent String from #MOBILE_USER_AGENTS array.
get Browser from user agent
get Os from user agent
get Bot Name from user agent
is IE user agent from connection String
get Browser Name from user agent via regex
is Apple Webkit user agent
is Ipad Or Iphone user agent
get IE Version from user agent
get Browser Type from user agent
Get USER AGENT from HttpServletRequest
get Browser Version From User Agent
库
apache http
Client GZip Content Compression using apache http
Client Execute Direct using apache http
Client Connection Release using apache http
Client GZip Content Compression via apache http
apache http client request and response handler
Create json object from http request using apache http
use multipart/form encoded POST request apache http client
create HttpClient pre-configured with support for integrated Windows authentication apache http client
CloseableHttpClient apache http client
Use ProxyClient to establish a tunnel through an HTTP proxy apache http client
use ResponseHandler to simplify the process of processing the HTTP response and releasing associated
ClientWithRequestFuture apache http client
uses HttpClient to execute an HTTP request over a secure connection tunneled through an authenticati
HttpClient customized to authenticate preemptively using DIGEST scheme apache http client
HttpClient customized to authenticate preemptively using BASIC scheme. apache http client
performs GETs from multiple threads. apache http client
HttpClient APIs can be used to perform form-based logon apache http client
send a request via SOCKS proxy apache http client
send a request via proxy apache http client
evict expired and idle connections from the connection pool apache http client
create secure connections with a custom SSL context apache http client
use a custom public suffix list apache http client
use of a local HTTP context populated with custom attributes apache http client
using API to make sure the underlying connection gets released back to the connection manager apache http client
customize and configure the most common aspects of HTTP request execution and connection management apache http client
use unbuffered chunk-encoded POST request apache http client
uses HttpClient to execute an HTTP request against a target site that requires user authentication apache http client
abort an HTTP method before its normal completion apache http client
HttpClient fluent API can be used to handle HTTP responses without buffering content body in memory apache http client
request execution with the HttpClient fluent API apache http client
Fluent Quick Start apache http client
execute multiple requests within the same security context apache http client
execute multiple requests asynchronously using background threads apache http client
use ResponseHandler to simplify processing the HTTP response and releasing associated resources.
无名称
RSS
read a RSS feed and output to console
Represents an aggregated list of CNN and Reuters RSS feeds into a single feed.
Represents an USGS/Atom feeds
Use rome library to get RSS feed
Use Rome to Read RSS