Add the interfaces from the Chronicle Engine Subscription RFC.

This commit is contained in:
Peter Lawrey
2015-04-30 10:15:18 +01:00
parent c704abaf04
commit 4aff5c81ce
3 changed files with 30 additions and 17 deletions
@@ -9,6 +9,7 @@ import net.openhft.lang.model.Copyable;
* Created by peter.lawrey on 23/04/2015.
*/
public class DoubleArray implements Byteable, Copyable<DoubleArray> {
static boolean HACK = true;
private static int CAPACITY = 0; // assume a 32-bit size.
private static int LENGTH = CAPACITY + 4; // assume a 32-bit size.
private static int BASE = LENGTH + 4;
@@ -49,7 +50,7 @@ public class DoubleArray implements Byteable, Copyable<DoubleArray> {
}
public int length() {
return bytes == null ? 6 * 8 : bytes.readInt(LENGTH + offset);
return HACK && bytes == null ? 6 * 8 : bytes.readInt(LENGTH + offset);
}
public int capacity() {