wrdataevent.java

来自「支持任天堂wii2手柄的java中间件」· Java 代码 · 共 65 行

JAVA
65
字号
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   WRDataEvent.java

package wiiremotej.event;

import wiiremotej.WiiRemote;
import wiiremotej.WiiRemoteJ;

// Referenced classes of package wiiremotej.event:
//			WREvent

public class WRDataEvent extends WREvent
{

	private byte readData[];
	private int dataOffset;
	private int errorCode;
	public static final int BYTES_DO_NOT_EXIST_ERROR = 8;
	public static final int WRITE_ONLY_REGISTER_ERROR = 7;
	public static final int NO_ERROR = 0;

	public WRDataEvent(WiiRemote wiiremote, byte abyte0[])
	{
		super(wiiremote);
		readData = null;
		dataOffset = -1;
		errorCode = abyte0[4] & 0xf;
		if (errorCode != 0)
			return;
		int i = ((abyte0[4] & 0xf0) >> 4) + 1;
		dataOffset = WiiRemoteJ.bytesToInt(new byte[] {
			abyte0[5], abyte0[6]
		});
		readData = new byte[i];
		for (int j = 0; j < i; j++)
			readData[j] = abyte0[j + 7];

	}

	public WRDataEvent(WiiRemote wiiremote, byte abyte0[], int i, int j)
	{
		super(wiiremote);
		readData = abyte0;
		errorCode = i;
		dataOffset = j;
	}

	public int getErrorCode()
	{
		return errorCode;
	}

	public int getDataOffset()
	{
		return dataOffset;
	}

	public byte[] getData()
	{
		return readData;
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?