From d04fb0f282e0fd9a4bc80d3f9d5ee15506a3b83b Mon Sep 17 00:00:00 2001
From: gbellato <gbellato@localhost>
Date: Mon, 08 Dec 2008 08:03:33 +0000
Subject: [PATCH] Merge the replication-service branch with the OpenDS trunk
---
opends/src/server/org/opends/server/replication/protocol/EntryMsg.java | 29 +++++++++++++++++++++++++++--
1 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/opends/src/server/org/opends/server/replication/protocol/EntryMsg.java b/opends/src/server/org/opends/server/replication/protocol/EntryMsg.java
index 6e54b2e..c05e2ae 100644
--- a/opends/src/server/org/opends/server/replication/protocol/EntryMsg.java
+++ b/opends/src/server/org/opends/server/replication/protocol/EntryMsg.java
@@ -43,14 +43,39 @@
/**
* Creates a new EntryMsg.
*
+ * @param sender The sender of this message.
+ * @param destination The destination of this message.
+ * @param entryBytes The bytes of the entry.
+ */
+ public EntryMsg(
+ short sender,
+ short destination,
+ byte[] entryBytes)
+ {
+ super(sender, destination);
+ this.entryByteArray = new byte[entryBytes.length];
+ System.arraycopy(entryBytes, 0, this.entryByteArray, 0, entryBytes.length);
+ }
+
+ /**
+ * Creates a new EntryMsg.
+ *
* @param sender The sender of this message.
* @param destination The destination of this message.
* @param entryBytes The bytes of the entry.
+ * @param pos The starting Position in the array.
+ * @param length Number of array elements to be copied.
*/
- public EntryMsg(short sender, short destination, byte[] entryBytes)
+ public EntryMsg(
+ short sender,
+ short destination,
+ byte[] entryBytes,
+ int pos,
+ int length)
{
super(sender, destination);
- this.entryByteArray = entryBytes.clone();
+ this.entryByteArray = new byte[length];
+ System.arraycopy(entryBytes, pos, this.entryByteArray, 0, length);
}
/**
--
Gitblit v1.10.0