gt:                 { Data[j] = new DataBlock(); }
context: /**
   * A library to interact with Virtual Worlds such as OpenSim
   * Copyright (C) 2012  Jitendra Chauhan, Email: jitendra.chauhan@gmail.com
   *
   * This library is free software; you can redistribute it and/or modify it under
   * the terms of the GNU Lesser General Public License as published by
   * the Free Software Foundation; either version 2.1 of the License,
   * or (at your option) any later version.
   *
   * This library is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   * See the GNU Lesser General Public License for more details.
   *
   * You should have received a copy of the GNU Lesser General Public License
   * along with this library; if not, write to the Free Software Foundation,
   * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
   */
  package com.ngt.jopenmetaverse.shared.protocol;
  
  import java.util.ArrayList;
  import java.util.List;
  import com.ngt.jopenmetaverse.shared.types.UUID;
  import com.ngt.jopenmetaverse.shared.util.Utils;
  	public final class GroupNoticesListReplyPacket extends Packet
      {
          /// <exclude/>
          public static final class AgentDataBlock extends PacketBlock
          {
              public UUID AgentID = new UUID();
              public UUID GroupID = new UUID();
  
              @Override
  			public int getLength()
              {
                                  {
                      return 32;
                  }
              }
  
              public AgentDataBlock() { }
              public AgentDataBlock(byte[] bytes, int[] i) throws MalformedDataException
              {
                  FromBytes(bytes, i);
              }
  
              @Override
  			public void FromBytes(byte[] bytes, int[] i) throws MalformedDataException
              {
                  try
                  {
                      AgentID.FromBytes(bytes, i[0]); i[0] += 16;
                      GroupID.FromBytes(bytes, i[0]); i[0] += 16;
                  }
                  catch (Exception e)
                  {
                      throw new MalformedDataException(Utils.getExceptionStackTraceAsString(e));
                  }
              }
  
              @Override
  			public void ToBytes(byte[] bytes, int[] i)
              {
                  AgentID.ToBytes(bytes, i[0]); i[0] += 16;
                  GroupID.ToBytes(bytes, i[0]); i[0] += 16;
              }
  
          }
  
          /// <exclude/>
          public static final class DataBlock extends PacketBlock
          {
              public UUID NoticeID = new UUID();
              public long Timestamp;
  		/** Unsigned Byte */ 
  		public byte[] FromName;
  		/** Unsigned Byte */ 
  		public byte[] Subject;
              public boolean HasAttachment;
  		/** Unsigned Byte */ 
  		public byte AssetType;
  
              @Override
  			public int getLength()
              {
                                  {
                      int length = 26;
                      if (FromName != null) { length += FromName.length; }
                      if (Subject != null) { length += Subject.length; }
                      return length;
                  }
              }
  
              public DataBlock() { }
              public DataBlock(byte[] bytes, int[] i) throws MalformedDataException
              {
                  FromBytes(bytes, i);
              }
  
              @Override
  			public void FromBytes(byte[] bytes, int[] i) throws MalformedDataException
              {
                  int length;
                  try
                  {
                      NoticeID.FromBytes(bytes, i[0]); i[0] += 16;
                      Timestamp = Utils.bytesToUIntLit(bytes, i[0]); i[0] += 4;
                      length = Utils.bytesToUInt16Lit(bytes, i[0]); i[0] += 2;
                      FromName = new byte[length];
                      Utils.arraycopy(bytes, i[0], FromName, 0, length); i[0] +=  length;
                      length = Utils.bytesToUInt16Lit(bytes, i[0]); i[0] += 2;
                      Subject = new byte[length];
                      Utils.arraycopy(bytes, i[0], Subject, 0, length); i[0] +=  length;
                      HasAttachment = (bytes[i[0]++] != 0) ? true : false;
                      AssetType = (byte)bytes[i[0]++];
                  }
                  catch (Exception e)
                  {
                      throw new MalformedDataException(Utils.getExceptionStackTraceAsString(e));
                  }
              }
  
              @Override
  			public void ToBytes(byte[] bytes, int[] i)
              {
                  NoticeID.ToBytes(bytes, i[0]); i[0] += 16;
                  Utils.uintToBytesLit(Timestamp, bytes, i[0]); i[0] += 4;
                  bytes[i[0]++] = (byte)(FromName.length % 256);
                  bytes[i[0]++] = (byte)((FromName.length >> 8) % 256);
                  Utils.arraycopy(FromName, 0, bytes, i[0], FromName.length); i[0] +=  FromName.length;
                  bytes[i[0]++] = (byte)(Subject.length % 256);
                  bytes[i[0]++] = (byte)((Subject.length >> 8) % 256);
                  Utils.arraycopy(Subject, 0, bytes, i[0], Subject.length); i[0] +=  Subject.length;
                  bytes[i[0]++] = (byte)((HasAttachment) ? 1 : 0);
                  bytes[i[0]++] = AssetType;
              }
  
          }
  
          @Override
  			public int getLength()
          {
                          {
                  int length = 11;
                  length += AgentData.getLength();
                  for (int j = 0; j < Data.length; j++)
                      length += Data[j].getLength();
                  return length;
              }
          }
          public AgentDataBlock AgentData;
          public DataBlock[] Data;
  
          public GroupNoticesListReplyPacket()
          {
              HasVariableBlocks = true;
              Type = PacketType.GroupNoticesListReply;
              this.header =  new Header();
              header.Frequency = PacketFrequency.Low;
              header.ID = 59;
              header.Reliable = true;
              AgentData = new AgentDataBlock();
              Data = null;
          }
  
          public GroupNoticesListReplyPacket(byte[] bytes, int[] i) throws MalformedDataException 
  		{
  		this();
              int[] packetEnd = new int[] {bytes.length - 1};
              FromBytes(bytes, i, packetEnd, null);
          }
  
          @Override
  		public void FromBytes(byte[] bytes, int[] i, int[] packetEnd, byte[] zeroBuffer) throws MalformedDataException
          {
              header.FromBytes(bytes, i, packetEnd);
              if (header.Zerocoded && zeroBuffer != null)
              {
                  packetEnd[0] = Helpers.ZeroDecode(bytes, packetEnd[0] + 1, zeroBuffer) - 1;
                  bytes = zeroBuffer;
              }
              AgentData.FromBytes(bytes, i);
              int count = Utils.ubyteToInt(bytes[i[0]++]);
              if(Data == null || Data.length != -1) {
                  Data = new DataBlock[count];
                  for(int j = 0; j < count; j++)
                  { Data[j] = new DataBlock(); }
              }
              for (int j = 0; j < count; j++)
              { Data[j].FromBytes(bytes, i); }
          }
  
          public GroupNoticesListReplyPacket(Header head, byte[] bytes, int[] i) throws MalformedDataException
  		{
  		this();
              int[] packetEnd = new int[] {bytes.length - 1};
              FromBytes(head, bytes, i, packetEnd);
          }
  
          @Override
  		public void FromBytes(Header header, byte[] bytes, int[] i, int[] packetEnd) throws MalformedDataException
          {
              this.header =  header;
              AgentData.FromBytes(bytes, i);
              int count = Utils.ubyteToInt(bytes[i[0]++]);
              if(Data == null || Data.length != count) {
                  Data = new DataBlock[count];
                  for(int j = 0; j < count; j++)
  