Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright (C) 2009 eXo Platform SAS.
   *
   * This 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 software 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 software; if not, write to the Free
  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  */
 package org.exoplatform.services.jcr.ext.initializer.impl;
 
 
Created by The eXo Platform SAS.
Date: 17.03.2009

Author(s):
Alex Reshetnyak
Version:
$Id: WorkspaceDataPacket.java 111 2008-11-11 11:11:11Z rainf0x $
 
 public class WorkspaceDataPacket extends AbstractPacket
 {

   
WORKSPACE_DATA_PACKET. the pocket type for workspace data
 
    public static final int WORKSPACE_DATA_PACKET = 100;

   
CRC.
 
    private byte[] crc;

   
Count of packets ChangesLog separated to.
 
    private long totalPacketsCount;

   
Current data position in total data byte array.
 
    private long offset;

   
Current data.
 
    private byte[] buffer;

   
Constructor.

Parameters:
type see AsyncPacketTypes
totalPacketsCount the total pocket in file
checksum the checksum of file
offset the offset
buffer the binary data
 
    public WorkspaceDataPacket(int typelong totalPacketsCountbyte[] checksumlong offsetbyte[] buffer)
    {
       super(type, -1);
       this. = totalPacketsCount;
       this. = checksum;
       this. = offset;
       this. = buffer;
    }

   
ChangesPacket constructor.
 
    public WorkspaceDataPacket()
    {
       super();
    }

   
getCRC.

Returns:
byte[] return the checksum
 
   public byte[] getCRC()
   {
      return this.;
   }

   
getPacketsCount.

Returns:
long return total packet count
   public long getPacketsCount()
   {
      return this.;
   }

   
getOffset.

Returns:
long the offset
   public long getOffset()
   {
      return this.;
   }

   
getBuffer.

Returns:
byte[] the binary data
   public byte[] getBuffer()
   {
      return this.;
   }

   
   public void writeExternal(ObjectOutput outthrows IOException
   {
      super.writeExternal(out);
      out.writeInt(.);
      out.write();
      out.writeLong();
      out.writeInt(.);
      out.write();
   }

   
   {
      super.readExternal(in);
       = new byte[in.readInt()];
      in.readFully();
       = in.readLong();
       = in.readLong();
      int bufSize = in.readInt();
       = new byte[bufSize];
      in.readFully();
   }
New to GrepCode? Check out our FAQ X