assertEquals( ( byte ) 0x00, result[3] );
assertEquals( ( byte ) 0x00, result[2] );
assertEquals( ( byte ) 0x00, result[1] );
assertEquals( ( byte ) 0x00, result[0] );
assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
// ------------------------------------------------------------------
value = 0x0000000000000001L;
result = serializer.serialize( value );
assertEquals( ( byte ) 0x01, result[7] );
assertEquals( ( byte ) 0x00, result[6] );
assertEquals( ( byte ) 0x00, result[5] );
assertEquals( ( byte ) 0x00, result[4] );
assertEquals( ( byte ) 0x00, result[3] );
assertEquals( ( byte ) 0x00, result[2] );
assertEquals( ( byte ) 0x00, result[1] );
assertEquals( ( byte ) 0x00, result[0] );
assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
// ------------------------------------------------------------------
value = 0x00000000000000FFL;
result = serializer.serialize( value );
assertEquals( ( byte ) 0xFF, result[7] );
assertEquals( ( byte ) 0x00, result[6] );
assertEquals( ( byte ) 0x00, result[5] );
assertEquals( ( byte ) 0x00, result[4] );
assertEquals( ( byte ) 0x00, result[3] );
assertEquals( ( byte ) 0x00, result[2] );
assertEquals( ( byte ) 0x00, result[1] );
assertEquals( ( byte ) 0x00, result[0] );
assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
// ------------------------------------------------------------------
value = 0x0000000000000100L;
result = serializer.serialize( value );
assertEquals( ( byte ) 0x00, result[7] );
assertEquals( ( byte ) 0x01, result[6] );
assertEquals( ( byte ) 0x00, result[5] );
assertEquals( ( byte ) 0x00, result[4] );
assertEquals( ( byte ) 0x00, result[3] );
assertEquals( ( byte ) 0x00, result[2] );
assertEquals( ( byte ) 0x00, result[1] );
assertEquals( ( byte ) 0x00, result[0] );
assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
// ------------------------------------------------------------------
value = 0x000000000000FFFFL;
result = serializer.serialize( value );
assertEquals( ( byte ) 0xFF, result[7] );
assertEquals( ( byte ) 0xFF, result[6] );
assertEquals( ( byte ) 0x00, result[5] );
assertEquals( ( byte ) 0x00, result[4] );
assertEquals( ( byte ) 0x00, result[3] );
assertEquals( ( byte ) 0x00, result[2] );
assertEquals( ( byte ) 0x00, result[1] );
assertEquals( ( byte ) 0x00, result[0] );
assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
// ------------------------------------------------------------------
value = 0x0000000000010000L;
result = serializer.serialize( value );
assertEquals( ( byte ) 0x00, result[7] );
assertEquals( ( byte ) 0x00, result[6] );
assertEquals( ( byte ) 0x01, result[5] );
assertEquals( ( byte ) 0x00, result[4] );
assertEquals( ( byte ) 0x00, result[3] );
assertEquals( ( byte ) 0x00, result[2] );
assertEquals( ( byte ) 0x00, result[1] );
assertEquals( ( byte ) 0x00, result[0] );
assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
// ------------------------------------------------------------------
value = 0x0000000000FFFFFFL;
result = serializer.serialize( value );
assertEquals( ( byte ) 0xFF, result[7] );
assertEquals( ( byte ) 0xFF, result[6] );
assertEquals( ( byte ) 0xFF, result[5] );
assertEquals( ( byte ) 0x00, result[4] );
assertEquals( ( byte ) 0x00, result[3] );
assertEquals( ( byte ) 0x00, result[2] );
assertEquals( ( byte ) 0x00, result[1] );
assertEquals( ( byte ) 0x00, result[0] );
assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
// ------------------------------------------------------------------
value = 0x0000000001000000L;
result = serializer.serialize( value );
assertEquals( ( byte ) 0x00, result[7] );
assertEquals( ( byte ) 0x00, result[6] );
assertEquals( ( byte ) 0x00, result[5] );
assertEquals( ( byte ) 0x01, result[4] );
assertEquals( ( byte ) 0x00, result[3] );
assertEquals( ( byte ) 0x00, result[2] );
assertEquals( ( byte ) 0x00, result[1] );
assertEquals( ( byte ) 0x00, result[0] );
assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
// ------------------------------------------------------------------
value = 0x000000007FFFFFFFL;
result = serializer.serialize( value );
assertEquals( ( byte ) 0xFF, result[7] );
assertEquals( ( byte ) 0xFF, result[6] );
assertEquals( ( byte ) 0xFF, result[5] );
assertEquals( ( byte ) 0x7F, result[4] );
assertEquals( ( byte ) 0x00, result[3] );
assertEquals( ( byte ) 0x00, result[2] );
assertEquals( ( byte ) 0x00, result[1] );
assertEquals( ( byte ) 0x00, result[0] );
assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
// ------------------------------------------------------------------
value = 0x0000000080000000L;
result = serializer.serialize( value );
assertEquals( ( byte ) 0x00, result[7] );
assertEquals( ( byte ) 0x00, result[6] );
assertEquals( ( byte ) 0x00, result[5] );
assertEquals( ( byte ) 0x80, result[4] );
assertEquals( ( byte ) 0x00, result[3] );
assertEquals( ( byte ) 0x00, result[2] );
assertEquals( ( byte ) 0x00, result[1] );
assertEquals( ( byte ) 0x00, result[0] );
assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
// ------------------------------------------------------------------
value = 0x00000000FFFFFFFFL;
result = serializer.serialize( value );
assertEquals( ( byte ) 0xFF, result[7] );
assertEquals( ( byte ) 0xFF, result[6] );
assertEquals( ( byte ) 0xFF, result[5] );
assertEquals( ( byte ) 0xFF, result[4] );
assertEquals( ( byte ) 0x00, result[3] );
assertEquals( ( byte ) 0x00, result[2] );
assertEquals( ( byte ) 0x00, result[1] );
assertEquals( ( byte ) 0x00, result[0] );
assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
// ------------------------------------------------------------------
value = 0x0000000100000000L;
result = serializer.serialize( value );
assertEquals( ( byte ) 0x00, result[7] );
assertEquals( ( byte ) 0x00, result[6] );
assertEquals( ( byte ) 0x00, result[5] );
assertEquals( ( byte ) 0x00, result[4] );
assertEquals( ( byte ) 0x01, result[3] );
assertEquals( ( byte ) 0x00, result[2] );
assertEquals( ( byte ) 0x00, result[1] );
assertEquals( ( byte ) 0x00, result[0] );
assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
// ------------------------------------------------------------------
value = 0x000000FFFFFFFFFFL;
result = serializer.serialize( value );
assertEquals( ( byte ) 0xFF, result[7] );
assertEquals( ( byte ) 0xFF, result[6] );
assertEquals( ( byte ) 0xFF, result[5] );
assertEquals( ( byte ) 0xFF, result[4] );
assertEquals( ( byte ) 0xFF, result[3] );
assertEquals( ( byte ) 0x00, result[2] );
assertEquals( ( byte ) 0x00, result[1] );
assertEquals( ( byte ) 0x00, result[0] );
assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
// ------------------------------------------------------------------
value = 0x0000010000000000L;
result = serializer.serialize( value );
assertEquals( ( byte ) 0x00, result[7] );
assertEquals( ( byte ) 0x00, result[6] );
assertEquals( ( byte ) 0x00, result[5] );
assertEquals( ( byte ) 0x00, result[4] );
assertEquals( ( byte ) 0x00, result[3] );
assertEquals( ( byte ) 0x01, result[2] );
assertEquals( ( byte ) 0x00, result[1] );
assertEquals( ( byte ) 0x00, result[0] );
assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
// ------------------------------------------------------------------
value = 0x0000FFFFFFFFFFFFL;
result = serializer.serialize( value );
assertEquals( ( byte ) 0xFF, result[7] );
assertEquals( ( byte ) 0xFF, result[6] );
assertEquals( ( byte ) 0xFF, result[5] );
assertEquals( ( byte ) 0xFF, result[4] );
assertEquals( ( byte ) 0xFF, result[3] );
assertEquals( ( byte ) 0xFF, result[2] );
assertEquals( ( byte ) 0x00, result[1] );
assertEquals( ( byte ) 0x00, result[0] );
assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
// ------------------------------------------------------------------
value = 0x0001000000000000L;
result = serializer.serialize( value );
assertEquals( ( byte ) 0x00, result[7] );
assertEquals( ( byte ) 0x00, result[6] );
assertEquals( ( byte ) 0x00, result[5] );
assertEquals( ( byte ) 0x00, result[4] );
assertEquals( ( byte ) 0x00, result[3] );
assertEquals( ( byte ) 0x00, result[2] );
assertEquals( ( byte ) 0x01, result[1] );
assertEquals( ( byte ) 0x00, result[0] );
assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
// ------------------------------------------------------------------
value = 0x00FFFFFFFFFFFFFFL;
result = serializer.serialize( value );
assertEquals( ( byte ) 0xFF, result[7] );
assertEquals( ( byte ) 0xFF, result[6] );
assertEquals( ( byte ) 0xFF, result[5] );
assertEquals( ( byte ) 0xFF, result[4] );
assertEquals( ( byte ) 0xFF, result[3] );
assertEquals( ( byte ) 0xFF, result[2] );
assertEquals( ( byte ) 0xFF, result[1] );
assertEquals( ( byte ) 0x00, result[0] );
assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
// ------------------------------------------------------------------
value = 0x0100000000000000L;
result = serializer.serialize( value );
assertEquals( ( byte ) 0x00, result[7] );
assertEquals( ( byte ) 0x00, result[6] );
assertEquals( ( byte ) 0x00, result[5] );
assertEquals( ( byte ) 0x00, result[4] );
assertEquals( ( byte ) 0x00, result[3] );
assertEquals( ( byte ) 0x00, result[2] );
assertEquals( ( byte ) 0x00, result[1] );
assertEquals( ( byte ) 0x01, result[0] );
assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
// ------------------------------------------------------------------
value = 0x7FFFFFFFFFFFFFFFL;
result = serializer.serialize( value );
assertEquals( ( byte ) 0xFF, result[7] );
assertEquals( ( byte ) 0xFF, result[6] );
assertEquals( ( byte ) 0xFF, result[5] );
assertEquals( ( byte ) 0xFF, result[4] );
assertEquals( ( byte ) 0xFF, result[3] );
assertEquals( ( byte ) 0xFF, result[2] );
assertEquals( ( byte ) 0xFF, result[1] );
assertEquals( ( byte ) 0x7F, result[0] );
assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
// ------------------------------------------------------------------
value = 0x8000000000000000L;
result = serializer.serialize( value );
assertEquals( ( byte ) 0x00, result[7] );
assertEquals( ( byte ) 0x00, result[6] );
assertEquals( ( byte ) 0x00, result[5] );
assertEquals( ( byte ) 0x00, result[4] );
assertEquals( ( byte ) 0x00, result[3] );
assertEquals( ( byte ) 0x00, result[2] );
assertEquals( ( byte ) 0x00, result[1] );
assertEquals( ( byte ) 0x80, result[0] );
assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
// ------------------------------------------------------------------
value = 0xFFFFFFFFFFFFFFFFL;
result = serializer.serialize( value );
assertEquals( ( byte ) 0xFF, result[7] );
assertEquals( ( byte ) 0xFF, result[6] );
assertEquals( ( byte ) 0xFF, result[5] );
assertEquals( ( byte ) 0xFF, result[4] );
assertEquals( ( byte ) 0xFF, result[3] );
assertEquals( ( byte ) 0xFF, result[2] );
assertEquals( ( byte ) 0xFF, result[1] );
assertEquals( ( byte ) 0xFF, result[0] );
assertEquals( value, serializer.deserialize( new BufferHandler( result ) ).longValue() );
}