N3header.Vinfo vinfo = (N3header.Vinfo) readVar.getSPobject();
assertTrue( vinfo.isRecord );
assertEquals( 1, vinfo.vsize );
Array byteData = readVar.read();
// File was created with the following data
// byte[] data = {1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -2, -3, -4, -5, -6, -7, -8, -9};
// But extra padding (see issue CDM-52) caused each byte to be padded out to 4 bytes.
assertEquals( 1, byteData.getByte( 0 ));
assertEquals( 0, byteData.getByte( 1 ));
assertEquals( 0, byteData.getByte( 2 ));
assertEquals( 0, byteData.getByte( 3 ));
assertEquals( 2, byteData.getByte( 4 ));
assertEquals( 0, byteData.getByte( 5 ));
assertEquals( 0, byteData.getByte( 6 ));
assertEquals( 0, byteData.getByte( 7 ));
assertEquals( 3, byteData.getByte( 8 ));
assertEquals( 0, byteData.getByte( 9 ));
assertEquals( 0, byteData.getByte( 10 ));
assertEquals( 0, byteData.getByte( 11 ));
assertEquals( 4, byteData.getByte( 12 ));
assertEquals( 0, byteData.getByte( 13 ));
assertEquals( 0, byteData.getByte( 14 ));
assertEquals( 0, byteData.getByte( 15 ));
assertEquals( 5, byteData.getByte( 16 ));
assertEquals( 0, byteData.getByte( 17 ));
try {
byteData.getByte( 18 );
} catch ( ArrayIndexOutOfBoundsException e ) {
return;
} catch ( Exception e) {
fail( "Unexpected exception: " + e.getMessage());
return;