JBBPFieldArrayLong extends JBBPAbstractArrayField<JBBPFieldLong> implements JBBPNumericArray { @Override public Object getValueArrayAsObject(final boolean reverseBits) { final long[] result; if (reverseBits) { result = this.array.clone(); for (int i = 0; i < result.length; i++) { result[i] = JBBPFieldLong.reverseBits(result[i]); } } else { result = this.array.clone(); } return result; } JBBPFieldArrayLong(final JBBPNamedFieldInfo name, final long[] array); long[] getArray(); @Override int size(); @Override JBBPFieldLong getElementAt(final int index); @Override int getAsInt(final int index); @Override long getAsLong(final int index); @Override boolean getAsBool(final int index); @Override Object getValueArrayAsObject(final boolean reverseBits); @Override String getTypeAsString();  }
@Test public void testGetValueArrayAsObject() { assertArrayEquals(array, (long[]) test.getValueArrayAsObject(false)); final long[] inverted = (long[]) test.getValueArrayAsObject(true); assertEquals(array.length, inverted.length); for (int i = 0; i < array.length; i++) { assertEquals(JBBPFieldLong.reverseBits(array[i]), inverted[i]); } }