@@ -0,0 +1,2611 @@
+package net.openhft.lang.values;%0A%0Aimport net.openhft.lang.io.Bytes;%0Aimport net.openhft.lang.io.DirectStore;%0Aimport net.openhft.lang.model.Byteable;%0A%0A/**%0A * Created by peter.lawrey on 23/04/2015.%0A */%0Apublic class DoubleArray implements Byteable %7B%0A    private static int LENGTH = 0; // assume a 32-bit size.%0A    private static int CAPACITY = LENGTH + 4; // assume a 32-bit size.%0A    private static int BASE = CAPACITY + 4;%0A%0A    private Bytes bytes;%0A    private long offset;%0A%0A    public DoubleArray(int capacity) %7B%0A        bytes = DirectStore.allocate(BASE + capacity * 8L).bytes();%0A        offset = 0;%0A    %7D%0A%0A    @Override%0A    public void bytes(Bytes bytes, long offset) %7B%0A        this.bytes = bytes;%0A        this.offset = offset;%0A    %7D%0A%0A    @Override%0A    public Bytes bytes() %7B%0A        return bytes;%0A    %7D%0A%0A    @Override%0A    public long offset() %7B%0A        return offset;%0A    %7D%0A%0A    @Override%0A    public int maxSize() %7B%0A        return BASE + length() * 8;%0A    %7D%0A%0A    public int length() %7B%0A        return bytes.readInt(LENGTH + offset);%0A    %7D%0A%0A    public int capacity() %7B%0A        return bytes.readInt(CAPACITY + offset);%0A    %7D%0A%0A    public double getDataAt(int index) %7B%0A        if (index %3C 0 %7C%7C index %3E= length()) throw new ArrayIndexOutOfBoundsException();%0A        return bytes.readDouble(BASE + offset + index * 8L);%0A    %7D%0A%0A    public void setDataAt(int index, double d) %7B%0A        if (index %3C 0 %7C%7C index %3E= capacity()) throw new ArrayIndexOutOfBoundsException();%0A        if (length() %3C= index)%0A            setLength(index + 1);%0A        bytes.writeDouble(BASE + offset + index * 8L, d);%0A    %7D%0A%0A    public void setLength(int length) %7B%0A        if (length %3C 0 %7C%7C length %3E= capacity()) throw new IllegalArgumentException();%0A        bytes.writeInt(LENGTH + offset, length);%0A    %7D%0A%0A    public void addData(double d) %7B%0A        int index = length();%0A        if (index %3E= capacity()) throw new IllegalStateException();%0A        bytes.writeInt(LENGTH + offset, index + 1);%0A        bytes.writeDouble(BASE + offset + index * 8L, d);%0A    %7D%0A%0A    public void setData(double%5B%5D doubles) %7B%0A        if (doubles.length %3E capacity()) throw new IllegalArgumentException();%0A        bytes.writeInt(LENGTH + offset, doubles.length);%0A        for (int index = 0; index %3C doubles.length; index++)%0A            bytes.writeDouble(BASE + offset + index * 8L, doubles%5Bindex%5D);%0A    %7D%0A%0A    public int getDataUsing(double%5B%5D doubles) %7B%0A        int length = Math.min(length(), doubles.length);%0A        for (int index = 0; index %3C length; index++)%0A            doubles%5Bindex%5D = bytes.readDouble(BASE + offset + index * 8L);%0A        return length;%0A    %7D%0A%7D%0A

Add a DoubleArray example.