📄 datagramevent.java
字号:
// DatagramEvent.java
//
// Copyright (c) 2000-2001 Symbian Ltd. All rights reserved
package com.symbian.devnet.whist.tokenRing;
/**
* Class producing events which indicate the reception of a new datagram.
* This class can also be used to access the received data.
* @author Symbian Devnet
*/
public class DatagramEvent extends java.util.EventObject
{
/** A reference to the content of the datagram */
private byte[] data;
/**
* Constructor for the class.
* @param source The Receiver object that produced this event
* @param data A reference to the raw data contained
* within the datagram which will be available to
* listeners
*/
public DatagramEvent(Object source, byte[] data)
{
super(source);
this.data = data;
}
/**
* Method to retrieve a reference to the raw data
* contained within the received datagram that
* caused this event
*/
public byte[] getData()
{
byte[] newdata = new byte[data.length];
for (int i = 0; i < data.length; i++)
newdata[i] = data[i];
return newdata;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -