There are two constructors for DatagramPacket objects in Java 1.1. The dịch - There are two constructors for DatagramPacket objects in Java 1.1. The Việt làm thế nào để nói

There are two constructors for Data

There are two constructors for DatagramPacket objects in Java 1.1. The first
constructor is used to receive data from the Net; the second is for data that you will
send to the Net. (Java 1.2 adds two more constructors, one each for sending and
receiving, though these don't differ in a major way.)
This is a little unusual. Normally, constructors are overloaded to let you provide
different kinds of information when you create an object, not to create objects of the
same class that will be used in different contexts. In this case, all four constructors
take as arguments a byte array that holds the datagram's data, and the number of
bytes in that array to use for the datagram's data. When you want to receive a
datagram, these are the only arguments you provide; in addition, the array should be
empty. When the socket receives a datagram from the network, it store's the
datagram's data in the DatagramPacket object's buffer array, up to the length you
specified.
The second pair of DatagramPacket constructors is used to create datagrams you will
send to the Net. Like the first, these constructors require a buffer array and a length,
but they also require the InetAddress and port to which the packet is to be sent. In
this case, you will pass to the constructor a byte array containing the data you want to
send and the destination address and port to which the packet is to be sent. The
DatagramSocket reads the destination address and port from the packet; the address
and port aren't stored within the socket, as they are in TCP.
0/5000
Từ: -
Sang: -
Kết quả (Việt) 1: [Sao chép]
Sao chép!
Không có hai nhà thầu cho các đối tượng DatagramPacket trong Java 1.1. Người đầu tiênnhà xây dựng được sử dụng để nhận được dữ liệu từ mạng; Thứ hai là dữ liệu mà bạn sẽgửi đến mạng. (Java 1.2 thêm hai nhà thầu thêm, một trong mỗi cho việc gửi vànhận được, mặc dù chúng không khác nhau trong một cách lớn.)Đây là một chút bất thường. Thông thường, nhà thầu đang quá tải để bạn cung cấpCác loại khác nhau của thông tin khi bạn tạo một đối tượng, không để tạo ra các đối tượng của cáccùng một lớp học sẽ được sử dụng trong ngữ cảnh khác nhau. Trong trường hợp này, tất cả bốn nhà hàng thầucó như là đối số một mảng byte chứa dữ liệu của datagram, và số lượngbyte trong đó mảng để sử dụng cho dữ liệu của datagram. Khi bạn muốn nhận được mộtdatagram, đây là các đối số duy nhất, bạn cung cấp; Ngoài ra, các mảng nênsản phẩm nào. Khi các ổ cắm nhận được một datagram từ mạng, nó lưu trữ của cácdatagram của dữ liệu trong bộ đệm của đối tượng DatagramPacket mảng, lên đến độ dài bạnđược chỉ định.Cặp DatagramPacket nhà thầu, thứ hai được sử dụng để tạo gói bạn sẽgửi đến mạng. Giống như lần đầu tiên, các nhà thầu cần một mảng bộ đệm và một chiều dài,nhưng họ cũng yêu cầu InetAddress và cổng mà gói là để được gửi. Ởtrường hợp này, bạn sẽ vượt qua các nhà xây dựng một mảng byte có chứa dữ liệu bạn muốngửi và các điểm đến địa chỉ và cổng mà gói là để được gửi. CácDatagramSocket đọc điểm đến địa chỉ và cổng từ gói; địa chỉvà cổng không được lưu trữ trong các ổ cắm, như họ đang có trong TCP.
đang được dịch, vui lòng đợi..
Kết quả (Việt) 2:[Sao chép]
Sao chép!
There are two constructors for DatagramPacket objects in Java 1.1. The first
constructor is used to receive data from the Net; the second is for data that you will
send to the Net. (Java 1.2 adds two more constructors, one each for sending and
receiving, though these don't differ in a major way.)
This is a little unusual. Normally, constructors are overloaded to let you provide
different kinds of information when you create an object, not to create objects of the
same class that will be used in different contexts. In this case, all four constructors
take as arguments a byte array that holds the datagram's data, and the number of
bytes in that array to use for the datagram's data. When you want to receive a
datagram, these are the only arguments you provide; in addition, the array should be
empty. When the socket receives a datagram from the network, it store's the
datagram's data in the DatagramPacket object's buffer array, up to the length you
specified.
The second pair of DatagramPacket constructors is used to create datagrams you will
send to the Net. Like the first, these constructors require a buffer array and a length,
but they also require the InetAddress and port to which the packet is to be sent. In
this case, you will pass to the constructor a byte array containing the data you want to
send and the destination address and port to which the packet is to be sent. The
DatagramSocket reads the destination address and port from the packet; the address
and port aren't stored within the socket, as they are in TCP.
đang được dịch, vui lòng đợi..
 
Các ngôn ngữ khác
Hỗ trợ công cụ dịch thuật: Albania, Amharic, Anh, Armenia, Azerbaijan, Ba Lan, Ba Tư, Bantu, Basque, Belarus, Bengal, Bosnia, Bulgaria, Bồ Đào Nha, Catalan, Cebuano, Chichewa, Corsi, Creole (Haiti), Croatia, Do Thái, Estonia, Filipino, Frisia, Gael Scotland, Galicia, George, Gujarat, Hausa, Hawaii, Hindi, Hmong, Hungary, Hy Lạp, Hà Lan, Hà Lan (Nam Phi), Hàn, Iceland, Igbo, Ireland, Java, Kannada, Kazakh, Khmer, Kinyarwanda, Klingon, Kurd, Kyrgyz, Latinh, Latvia, Litva, Luxembourg, Lào, Macedonia, Malagasy, Malayalam, Malta, Maori, Marathi, Myanmar, Mã Lai, Mông Cổ, Na Uy, Nepal, Nga, Nhật, Odia (Oriya), Pashto, Pháp, Phát hiện ngôn ngữ, Phần Lan, Punjab, Quốc tế ngữ, Rumani, Samoa, Serbia, Sesotho, Shona, Sindhi, Sinhala, Slovak, Slovenia, Somali, Sunda, Swahili, Séc, Tajik, Tamil, Tatar, Telugu, Thái, Thổ Nhĩ Kỳ, Thụy Điển, Tiếng Indonesia, Tiếng Ý, Trung, Trung (Phồn thể), Turkmen, Tây Ban Nha, Ukraina, Urdu, Uyghur, Uzbek, Việt, Xứ Wales, Yiddish, Yoruba, Zulu, Đan Mạch, Đức, Ả Rập, dịch ngôn ngữ.

Copyright ©2025 I Love Translation. All reserved.

E-mail: