package com.njcn.csharmonic.offline.mincfg.vo;

public class RTC_Timer_MS //数据时标
{
	//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: public ushort year;
	public short year;
	//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: public ushort month;
	public short month;
	//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: public ushort day;
	public short day;
	//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: public ushort hour;
	public short hour;
	//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: public ushort minute;
	public short minute;
	//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: public ushort second;
	public short second;
	//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: public ushort millisecond;
	public short millisecond;
	public static int GetSize()
	{
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		return 7 * Short.SIZE / Byte.SIZE;
	}
	public final boolean SetStructBuf(byte[] bArray, int nHaveRead)
	{
		int nByteSize = bArray.length;
		if (nByteSize < GetSize())
		{
			return false;
		}

		int iStep = nHaveRead;

		year = Service.convertUInt16_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Short.SIZE / Byte.SIZE;
		month = Service.convertUInt16_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Short.SIZE / Byte.SIZE;
		day = Service.convertUInt16_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Short.SIZE / Byte.SIZE;
		hour = Service.convertUInt16_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Short.SIZE / Byte.SIZE;
		minute = Service.convertUInt16_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Short.SIZE / Byte.SIZE;
		second = Service.convertUInt16_net(bArray, iStep);
//C# TO JAVA CONVERTER TODO TASK: There is no Java equivalent to 'sizeof':
		iStep += Short.SIZE / Byte.SIZE;
		millisecond = Service.convertUInt16_net(bArray, iStep);
		return true;
	}

	/**
	 @brief 将类中的变量组装成byte[]二进制流
	 @return byte[] out 二进制数组

	 */
	public final int GetStructBuf(RefObject<Byte[]> bArray, int nHaveRead)
	{
		int nSize = bArray.argvalue.length;
		if (nSize < (nHaveRead + GetSize()))
		{
			return 0;
		}
		int iStep = nHaveRead;
		iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Short)year, Service.enum_Value_type.Value_ushort);
		iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Short)month, Service.enum_Value_type.Value_ushort);
		iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Short)day, Service.enum_Value_type.Value_ushort);
		iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Short)hour, Service.enum_Value_type.Value_ushort);
		iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Short)minute, Service.enum_Value_type.Value_ushort);
		iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Short)second, Service.enum_Value_type.Value_ushort);
		iStep += Service.AddObjectToByteArray_net(bArray, iStep, (Object)(Short)millisecond, Service.enum_Value_type.Value_ushort);
		return GetSize();
	}
}